Replace non-printable characters in files too.
This commit is contained in:
parent
a1ef3beca2
commit
3857954d9e
@ -38,7 +38,7 @@ def logger(file, write=True, display=True):
|
|||||||
if display:
|
if display:
|
||||||
print(timestamp + output, file=utf8stdout)
|
print(timestamp + output, file=utf8stdout)
|
||||||
if write and file is not None:
|
if write and file is not None:
|
||||||
with open(file, "a") as f:
|
with open(file, "a", errors="replace") as f:
|
||||||
f.seek(0, 2)
|
f.seek(0, 2)
|
||||||
f.write(timestamp + output + "\n")
|
f.write(timestamp + output + "\n")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user