Skip to content

Commit d714da4

Browse files
authored
Merge pull request python-telegram-bot#500 from python-telegram-bot/bug470
Fix bad formatting of BadRequest exception message Fixes python-telegram-bot#470
2 parents e39afad + 4c7cc3a commit d714da4

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

telegram/bot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ def sendDocument(self,
415415
chat_id: Unique identifier for the message recipient - Chat id.
416416
document: File to send. You can either pass a file_id as String to resend a file that
417417
is already on the Telegram servers, or upload a new file using multipart/form-data.
418-
filename (Optional[str]): File name that shows in telegram message (it is usefull when
418+
filename (Optional[str]): File name that shows in telegram message (it is useful when
419419
you send file generated by temp module, for example).
420420
caption (Optional[str]): Document caption (may also be used when resending documents by
421421
file_id), 0-200 characters.

telegram/utils/request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def _request_wrapper(self, *args, **kwargs):
182182
if resp.status in (401, 403):
183183
raise Unauthorized()
184184
elif resp.status == 400:
185-
raise BadRequest(repr(message))
185+
raise BadRequest(message)
186186
elif resp.status == 404:
187187
raise InvalidToken()
188188
elif resp.status == 502:

tests/test_bot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ def test_set_game_score3(self):
365365
chat_id=game.chat_id,
366366
message_id=game.message_id)
367367

368-
self.assertTrue('BOT_SCORE_NOT_MODIFIED' in cm.exception.message)
368+
self.assertTrue('BOT_SCORE_NOT_MODIFIED' in str(cm.exception.message).upper())
369369

370370
@flaky(3, 1)
371371
@timeout(10)

0 commit comments

Comments
 (0)