diff options
author | Ćukasz Langa <lukasz@langa.pl> | 2023-10-27 09:43:01 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-27 09:43:01 (GMT) |
commit | 6d42759c5e47ab62d60a72b4ff15d29864554579 (patch) | |
tree | 49858d07c6a68ed2dca864fa608b48cc29f34f9d /Doc/library/locale.rst | |
parent | 74f0772892c85b6e7bdfa0f44a5ff89002b0734d (diff) | |
download | cpython-6d42759c5e47ab62d60a72b4ff15d29864554579.zip cpython-6d42759c5e47ab62d60a72b4ff15d29864554579.tar.gz cpython-6d42759c5e47ab62d60a72b4ff15d29864554579.tar.bz2 |
gh-111276: Clarify docs and comments about the role of LC_CTYPE (#111319)
Fix locale.LC_CTYPE documentation to no longer mention string.lower() et al. Those functions were removed in Python 3.0:
https://docs.python.org/2/library/string.html#deprecated-string-functions
Also, fix a comment in logging about locale-specific behavior of `str.lower()`.
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Diffstat (limited to 'Doc/library/locale.rst')
-rw-r--r-- | Doc/library/locale.rst | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Doc/library/locale.rst b/Doc/library/locale.rst index 865969e..0d48892 100644 --- a/Doc/library/locale.rst +++ b/Doc/library/locale.rst @@ -454,11 +454,16 @@ The :mod:`locale` module defines the following exception and functions: .. data:: LC_CTYPE - .. index:: pair: module; string - - Locale category for the character type functions. Depending on the settings of - this category, the functions of module :mod:`string` dealing with case change - their behaviour. + Locale category for the character type functions. Most importantly, this + category defines the text encoding, i.e. how bytes are interpreted as + Unicode codepoints. See :pep:`538` and :pep:`540` for how this variable + might be automatically coerced to ``C.UTF-8`` to avoid issues created by + invalid settings in containers or incompatible settings passed over remote + SSH connections. + + Python doesn't internally use locale-dependent character transformation functions + from ``ctype.h``. Instead, an internal ``pyctype.h`` provides locale-independent + equivalents like :c:macro:`!Py_TOLOWER`. .. data:: LC_COLLATE |