2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-12-23 19:52:10 +00:00

Fallback to forced utf8 on unicodeerror

If LC_ALL is set to C, then unicode can be a problem.
This commit is contained in:
Jarrod Johnson 2021-01-21 08:41:35 -05:00
parent 203253e05f
commit 6997508a0c

View File

@ -948,6 +948,8 @@ def main():
clearpowermessage = False
try:
sys.stdout.write(data)
except UnicodeEncodeError:
sys.stdout.buffer.write(data.encode('utf8'))
except IOError: # Some times circumstances are bad
# resort to byte at a time...
for d in data: