From 7b87d805609cd489a3978f8272e14eec4e41bd5a Mon Sep 17 00:00:00 2001 From: Jamie Alexandre Date: Tue, 27 Jun 2017 13:43:44 -0700 Subject: [PATCH] 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. --- buildozer/targets/android.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index 9914000..40e3207 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -851,7 +851,7 @@ class TargetAndroid(Target): # recreate the project.properties with io.open(project_fn, 'w', encoding='utf-8') as fd: try: - fd.writelines((line.encode('utf-8') for line in content)) + fd.writelines((line.decode('utf-8') for line in content)) except: fd.writelines(content) if not content[-1].endswith(u'\n'):