1
0
Fork 0

generate: log: Add encoding=utf-8 to Path.open

Specify the encoding to use for the logfile.

Signed-off-by: Enno Tensing <tenno@suij.in>
This commit is contained in:
Enno Tensing 2025-07-22 15:57:23 +02:00
parent 7200d09621
commit 53622827a0
Signed by: tenno
GPG key ID: 95265603BD36E66C

View file

@ -64,7 +64,7 @@ class Log:
print(msg) print(msg)
if self.logfile == Path("/dev/stdout"): if self.logfile == Path("/dev/stdout"):
return return
with self.logfile.open("a+") as f: with self.logfile.open("a+", encoding="utf-8") as f:
f.write(msg) f.write(msg)
def timestamp(self) -> str: def timestamp(self) -> str: