mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
allow urllib2 to be passed unicode data to send (#923)
This commit is contained in:
parent
2754ead0a4
commit
a1ca03ee17
1 changed files with 2 additions and 0 deletions
|
@ -413,6 +413,8 @@ def _incrementalSend(self, data):
|
|||
raise httplib.NotConnected()
|
||||
# if it's not a file object, make it one
|
||||
if not hasattr(data, 'read'):
|
||||
if isinstance(data, unicode):
|
||||
data = data.encode("utf8")
|
||||
data = StringIO(data)
|
||||
while 1:
|
||||
block = data.read(CHUNK_SIZE)
|
||||
|
|
Loading…
Reference in a new issue