mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-17 04:39:55 +01:00
Fixes unicode erros when sending files
This commit is contained in:
parent
7924ba1bdb
commit
5c6d233179
3 changed files with 5 additions and 5 deletions
|
@ -554,7 +554,7 @@ class Bot(object):
|
|||
json_data = self._requestUrl(url, 'POST', data=data)
|
||||
data = self._parseAndCheckTelegram(json_data)
|
||||
|
||||
return [Update.de_json(x) for x in data] # TODO: error handling
|
||||
return [Update.de_json(x) for x in data]
|
||||
|
||||
def setWebhook(self, webhook_url=""):
|
||||
"""Use this method to specify a url and receive incoming updates via an
|
||||
|
|
|
@ -47,7 +47,7 @@ class InputFile(object):
|
|||
for name, value in self.data.iteritems():
|
||||
form.extend([
|
||||
form_boundary,
|
||||
'Content-Disposition: form-data; name="%s"' % name,
|
||||
str('Content-Disposition: form-data; name="%s"' % name),
|
||||
'',
|
||||
str(value)
|
||||
])
|
||||
|
@ -55,9 +55,9 @@ class InputFile(object):
|
|||
# Add input_file to upload
|
||||
form.extend([
|
||||
form_boundary,
|
||||
'Content-Disposition: form-data; name="%s"; filename="%s"' % (
|
||||
str('Content-Disposition: form-data; name="%s"; filename="%s"' % (
|
||||
self.input_name, self.filename
|
||||
),
|
||||
)),
|
||||
'Content-Type: %s' % self.mimetype,
|
||||
'',
|
||||
self.input_file_content
|
||||
|
|
|
@ -33,7 +33,7 @@ class BotTest(unittest.TestCase):
|
|||
'''Test the telegram.Bot getUpdates method'''
|
||||
print 'Testing getUpdates'
|
||||
updates = self._bot.getUpdates()
|
||||
self.assertEqual(129566572, updates[0].update_id)
|
||||
self.assertEqual(129566577, updates[0].update_id)
|
||||
|
||||
def testForwardMessage(self):
|
||||
'''Test the telegram.Bot forwardMessage method'''
|
||||
|
|
Loading…
Add table
Reference in a new issue