diff options
| author | Rapptz <[email protected]> | 2016-06-12 22:41:30 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-06-12 22:41:30 -0400 |
| commit | f3b257b3426601eb3366c67e8aa224ebcdb00565 (patch) | |
| tree | 2ea6c4dba41468a23c0ad7805e7659d78bc1f927 /discord/client.py | |
| parent | Fix bug with logging in with email and password. (diff) | |
| download | discord.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/client.py')
| -rw-r--r-- | discord/client.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/client.py b/discord/client.py index 3ef5bd74..4c1e36d1 100644 --- a/discord/client.py +++ b/discord/client.py @@ -49,7 +49,7 @@ import aiohttp import websockets import logging, traceback -import sys, re +import sys, re, io import tempfile, os, hashlib import itertools import datetime @@ -873,7 +873,7 @@ class Client: try: with open(fp, 'rb') as f: - buffer = f.read() + buffer = io.BytesIO(f.read()) if filename is None: filename = fp except TypeError: |