Skip to content

Commit 3ca631b

Browse files
authored
Merge pull request #1455 from SG-A2313513/patch-1
Fix encoding issues in logger.py
2 parents a2267a8 + d16876e commit 3ca631b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

activity_browser/logger.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __init__(self):
4343
log_file_location = self.filepath
4444

4545
# create the logfile and write the headers
46-
with open(self.filepath, "a") as log_file:
46+
with open(self.filepath, "a", encoding='utf-8') as log_file:
4747
log_file.write(";".join(self.headers) + "\n")
4848

4949
def emit(self, record: logging.LogRecord):
@@ -52,7 +52,7 @@ def emit(self, record: logging.LogRecord):
5252
message = self.format(record)
5353

5454
# append to the logfile
55-
with open(self.filepath, "a") as log_file:
55+
with open(self.filepath, "a", encoding='utf-8') as log_file:
5656
log_file.write(message)
5757

5858
# if there's exception info, write the exception traceback to the file as well
@@ -136,7 +136,7 @@ def emit(self, record: logging.LogRecord):
136136
message = self.format_log(record)
137137

138138
# append to the logfile
139-
with open(self.filepath, "a") as log_file:
139+
with open(self.filepath, "a", encoding='utf-8') as log_file:
140140
log_file.write(message)
141141

142142
# if there's exception info, write the exception traceback to the file as well

0 commit comments

Comments
 (0)