Steps to reproduce
-
Create an Updater with a valid bot token.
-
Call bot.sendMessage which will raise a BadRequest, such as with parse_mode="HTML" and text="<b>" (unclosed tag)
-
Catch the exception and read it. except BadRequest as e: look_at(e.message)
Expected behaviour
BadRequest message should say: Can't parse message text: Can't found end tag corresponding to start tag at byte offset 0
Actual behaviour
BadReqeust message actually says: u"Bad Request: Can't parse message text: Can't found end tag corresponding to start tag at byte offset 0" (notice it's literally surrounded with u" ")
Configuration
Operating System:
Debian
Version of Python, python-telegram-bot & dependencies:
$ python -m telegram
python-telegram-bot 5.2.0
urllib3 1.19.1
certifi 2016.09.26
future 0.16.0
Python 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2]
Notes
Notice the repr(message):
https://github.com/python-telegram-bot/python-telegram-bot/blob/master/telegram/utils/request.py#L152
Should the repr call be removed, or should message have another format?
Steps to reproduce
Create an
Updaterwith a valid bot token.Call
bot.sendMessagewhich will raise a BadRequest, such as withparse_mode="HTML"andtext="<b>"(unclosed tag)Catch the exception and read it.
except BadRequest as e: look_at(e.message)Expected behaviour
BadRequest message should say:
Can't parse message text: Can't found end tag corresponding to start tag at byte offset 0Actual behaviour
BadReqeust message actually says:
u"Bad Request: Can't parse message text: Can't found end tag corresponding to start tag at byte offset 0"(notice it's literally surrounded with u" ")Configuration
Operating System:
Debian
Version of Python, python-telegram-bot & dependencies:
$ python -m telegrampython-telegram-bot 5.2.0
urllib3 1.19.1
certifi 2016.09.26
future 0.16.0
Python 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2]
Notes
Notice the repr(message):
https://github.com/python-telegram-bot/python-telegram-bot/blob/master/telegram/utils/request.py#L152
Should the repr call be removed, or should message have another format?