Skip to content

Commit 15f84fd

Browse files
committed
Fix encoding errors for log files etc when using non windows characters
1 parent c2130aa commit 15f84fd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

nxc/logger.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ def __init__(self, extra=None):
9090
rich_tracebacks=True,
9191
tracebacks_show_locals=False
9292
)],
93+
encoding="utf-8"
9394
)
9495
self.logger = logging.getLogger("nxc")
9596
self.extra = extra
@@ -181,7 +182,7 @@ def add_file_log(self, log_file=None):
181182
open(output_file, "x") # noqa: SIM115
182183
file_creation = True
183184

184-
file_handler = RotatingFileHandler(output_file, maxBytes=100000)
185+
file_handler = RotatingFileHandler(output_file, maxBytes=100000, encoding="utf-8")
185186

186187
with file_handler._open() as f:
187188
if file_creation:

0 commit comments

Comments
 (0)