diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-12-15 11:37:32 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-12-15 12:04:10 +0200 |
commit | 4475f324202e15b98f2f365e33078aebcf0bc5a5 (patch) | |
tree | e7252c0c85c631b0c29bc1f548f3229fa0fb14a2 /tools/tinytest-codegen.py | |
parent | cf8e8c29e72ef4871b9d5ab3de32bdaf429c5dbb (diff) | |
download | micropython-4475f324202e15b98f2f365e33078aebcf0bc5a5.tar.gz micropython-4475f324202e15b98f2f365e33078aebcf0bc5a5.zip |
tools/tinytest-codegen: Ignore system locale, write output in UTF-8.
Way to reproduce a UnicodeEncodeError without this patch:
LC_ALL=C tinytest-codegen.py ...
Diffstat (limited to 'tools/tinytest-codegen.py')
-rwxr-xr-x | tools/tinytest-codegen.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/tinytest-codegen.py b/tools/tinytest-codegen.py index 5339972cd4..ad3b3bbec9 100755 --- a/tools/tinytest-codegen.py +++ b/tools/tinytest-codegen.py @@ -106,4 +106,5 @@ testgroup_members = [testgroup_member.format(name=group) for group in [""]] output.append(testgroup_struct.format(body='\n'.join(testgroup_members))) ## XXX: may be we could have `--output <filename>` argument... -print('\n\n'.join(output)) +# Don't depend on what system locale is set, use utf8 encoding. +sys.stdout.buffer.write('\n\n'.join(output).encode('utf8')) |