Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: localeTools.py

Issue 29560569: Issue 5815 - Fixed Crowdin upload with non-ASCII characters (Closed)
Patch Set: Created Oct. 1, 2017, 2:37 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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),
{
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld