Skip to content

Commit cee7718

Browse files
committed
Made logger convert output to utf-8 including errors
This prevents a regular error in the python2 build where the output is in byte format but is not valid utf-8, so the logger crashes because the format is wrong.
1 parent 96098ce commit cee7718

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pythonforandroid/logger.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ def shprint(command, *args, **kwargs):
174174
output = command(*args, **kwargs)
175175
for line in output:
176176
if logger.level > logging.DEBUG:
177+
if isinstance(line, bytes):
178+
line = line.decode('utf-8', errors='replace')
177179
msg = line.replace(
178180
'\n', ' ').replace(
179181
'\t', ' ').replace(

0 commit comments

Comments
 (0)