aboutsummaryrefslogtreecommitdiff
path: root/discord/http.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-06-12 22:41:30 -0400
committerRapptz <[email protected]>2016-06-12 22:41:30 -0400
commitf3b257b3426601eb3366c67e8aa224ebcdb00565 (patch)
tree2ea6c4dba41468a23c0ad7805e7659d78bc1f927 /discord/http.py
parentFix bug with logging in with email and password. (diff)
downloaddiscord.py-f3b257b3426601eb3366c67e8aa224ebcdb00565.tar.xz
discord.py-f3b257b3426601eb3366c67e8aa224ebcdb00565.zip
Fix bug with uploading file-like objects.
I would require bytes-like objects instead due to its usage inside the HTTPClient. Release this restriction so old `send_file` code works.
Diffstat (limited to 'discord/http.py')
-rw-r--r--discord/http.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/discord/http.py b/discord/http.py
index 15cd08ef..d8398920 100644
--- a/discord/http.py
+++ b/discord/http.py
@@ -29,7 +29,6 @@ import asyncio
import json
import sys
import logging
-import io
import inspect
import weakref
from random import randint as random_integer
@@ -239,7 +238,7 @@ class HTTPClient:
form.add_field('content', str(content))
form.add_field('tts', 'true' if tts else 'false')
- form.add_field('file', io.BytesIO(buffer), filename=filename, content_type='application/octet-stream')
+ form.add_field('file', buffer, filename=filename, content_type='application/octet-stream')
return self.post(url, data=form, bucket='messages:' + str(guild_id))