-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
logging using the SysLog handler fails if locale is set #43683
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
Comments
This affectes b2 and python 2.4 too. Looking at logging/handlers.py: Line 635: Line 611 in encodePriority: priority_names is declared on line 527: Now, if one initializes the locale (i.e. and then tries to use the logging module, it will fail File "/usr/lib64/python2.4/logging/handlers.py", line if they choose LANG=tr_TR.UTF-8 This happens because in that particular locale, |
Logged In: YES Fixed by using a dict to map logging level names to syslog Fix is checked into Subversion. |
For the record because this issue is mentioned in a comment in logging/handlers.py and people are sometimes confused by it today:
Since Python 3, this no longer happens: str.lower() and friends do not depend on the current locale. Specifically, the lower() and similar methods on Unicode strings (now "str", previously "unicode") were always independent of the current locale. The corresponding methods on byte strings (now "bytes", previously "str") did have this locale-dependent behavior, but that was replaced in commit 6ccd3f2, in 2007. See also bpo-37848, for a 2019 discussion of potentially adding an optional parameter to use an *explicit* locale. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: