Greg Price <gnpr...@gmail.com> added the comment:

For the record because this issue is mentioned in a comment in 
logging/handlers.py and people are sometimes confused by it today:

> This happens because in that particular locale,
> "INFO".lower() != "info"

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 
6ccd3f2dbcb98b33a71ffa6eae949deae797c09c, in 2007.

See also #37848, for a 2019 discussion of potentially adding an optional 
parameter to use an *explicit* locale.

----------
nosy: +Greg Price

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue1524081>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to