Skip to content

Commit

Permalink
Make sure the logging handler uses UTF-8 too
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamefire committed Feb 4, 2021
1 parent 0cba542 commit b8b12c8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions easybuild/base/fancylogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,8 @@ def logToFile(filename, enable=True, filehandler=None, name=None, max_bytes=MAX_
'maxBytes': max_bytes,
'backupCount': backup_count,
}
if sys.version_info[0] >= 3:
handleropts['encoding'] = 'utf-8'
# logging to a file is going to create the file later on, so let's try to be helpful and create the path if needed
directory = os.path.dirname(filename)
if not os.path.exists(directory):
Expand Down

0 comments on commit b8b12c8

Please sign in to comment.