Fix unicode coding error in android build target
Using Python 2.7, attempting to run `encode(utf-8)` was throwing `write() argument 1 must be unicode, not str`. As the file being written has `encoding='utf-8'`, I'm assuming the intention was to decode the lines from an `str` into a unicode string, and I believe that's what this change does. Please let me know if I've misinterpreted something. Making this change fixed my build locally. Also not sure where I should be targeting this.
This commit is contained in:
parent
480e726011
commit
7b87d80560
1 changed files with 1 additions and 1 deletions
|
@ -851,7 +851,7 @@ class TargetAndroid(Target):
|
||||||
# recreate the project.properties
|
# recreate the project.properties
|
||||||
with io.open(project_fn, 'w', encoding='utf-8') as fd:
|
with io.open(project_fn, 'w', encoding='utf-8') as fd:
|
||||||
try:
|
try:
|
||||||
fd.writelines((line.encode('utf-8') for line in content))
|
fd.writelines((line.decode('utf-8') for line in content))
|
||||||
except:
|
except:
|
||||||
fd.writelines(content)
|
fd.writelines(content)
|
||||||
if not content[-1].endswith(u'\n'):
|
if not content[-1].endswith(u'\n'):
|
||||||
|
|
Loading…
Add table
Reference in a new issue