Index: localeTools.py |
=================================================================== |
--- a/localeTools.py |
+++ b/localeTools.py |
@@ -344,7 +344,6 @@ |
boundary = '----------ThIs_Is_tHe_bouNdaRY_$' |
body = '' |
for name, data in files: |
- mimetype = mimetypes.guess_type(name)[0] |
body += ( |
'--{boundary}\r\n' |
'Content-Disposition: form-data; name="files[{name}]"; ' |
@@ -353,9 +352,10 @@ |
'Content-Transfer-Encoding: binary\r\n' |
'\r\n{data}\r\n' |
'--{boundary}--\r\n' |
- ).format(boundary=boundary, name=name, data=data, mimetype=mimetype) |
+ ).format(boundary=boundary, name=name, |
Vasily Kuznetsov
2017/10/01 09:54:28
I would put `name` on a separate line as well, it'
Sebastian Noack
2017/10/01 14:20:54
Done.
|
+ data=data.encode('utf-8'), |
Sebastian Noack
2017/10/01 02:42:07
data is a unicode object. When passing any unicode
|
+ mimetype=mimetypes.guess_type(name)[0]) |
Sebastian Noack
2017/10/01 02:42:07
Kinda unrelated, but since this line has to be wra
|
- body = body.encode('utf-8') |
return ( |
StringIO(body), |
{ |