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: Put each argument on seperate line Created Oct. 1, 2017, 2:20 p.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,11 @@
'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,
+ data=data.encode('utf-8'),
+ mimetype=mimetypes.guess_type(name)[0])
- 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