From 1dc269a1d6a6136fc33f1f81af4a71a3c8be593c Mon Sep 17 00:00:00 2001 From: Papoteur Date: Wed, 4 May 2022 08:47:30 +0200 Subject: More robust logging in file against internationalized strings --- src/msec/libmsec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/msec/libmsec.py b/src/msec/libmsec.py index fa5a121..f7b7f54 100755 --- a/src/msec/libmsec.py +++ b/src/msec/libmsec.py @@ -128,7 +128,7 @@ class Log: # log to file if log_file: try: - self.file_h = logging.FileHandler(self.log_path) + self.file_h = logging.FileHandler(self.log_path, encoding='utf-8', mode='a+') formatter = logging.Formatter('%(asctime)s %(levelname)s: %(message)s') self.file_h.setFormatter(formatter) self.logger.addHandler(self.file_h) -- cgit v1.2.1