New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify utf-8 as the encoding for log files. #6357
Conversation
@kyungSong @sihrc does this resolve your problem? |
This pull request fixes 1 alert when merging 1b30740 into 5a0c458 - view on LGTM.com fixed alerts:
|
I'll have to test and get back to you on this. I'll comment as soon as I find out if this fix works |
did you check this? |
@@ -221,7 +221,7 @@ def _detect_handler(self, logfile=None): | |||
logfile = sys.__stderr__ if logfile is None else logfile | |||
if hasattr(logfile, 'write'): | |||
return logging.StreamHandler(logfile) | |||
return WatchedFileHandler(logfile) | |||
return WatchedFileHandler(logfile, encoding='utf-8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a problem for existing log files? Other than that it would seem to cover most use cases. Maybe in the future it could become a setting.
hey, sorry for the late response, work was slamming this week. Yes, this solved it! (was using redis as backend, celery version 4.1.1) Thanks a bunch! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm for now
Note: Before submitting this pull request, please review our contributing
guidelines.
Description
Fixes #5144.