Skip to content

Commit

Permalink
Merge pull request #1087 from inclement/fix_logger_py3
Browse files Browse the repository at this point in the history
Made logger convert output to utf-8 including errors
  • Loading branch information
inclement authored Aug 13, 2017
2 parents 96098ce + cee7718 commit 86b8280
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pythonforandroid/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ def shprint(command, *args, **kwargs):
output = command(*args, **kwargs)
for line in output:
if logger.level > logging.DEBUG:
if isinstance(line, bytes):
line = line.decode('utf-8', errors='replace')
msg = line.replace(
'\n', ' ').replace(
'\t', ' ').replace(
Expand Down

0 comments on commit 86b8280

Please sign in to comment.