summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2024-10-08 08:27:49 (GMT)
committerGitHub <noreply@github.com>2024-10-08 08:27:49 (GMT)
commit93b9e6bd7d48150d8a5d16cea39246a980e073cb (patch)
tree1c685755350231585c12d2a4d76dc41aa314aaff /Doc/library
parent27390990fa9306e2a797a4eb2bd83c5bfc7cb186 (diff)
downloadcpython-93b9e6bd7d48150d8a5d16cea39246a980e073cb.zip
cpython-93b9e6bd7d48150d8a5d16cea39246a980e073cb.tar.gz
cpython-93b9e6bd7d48150d8a5d16cea39246a980e073cb.tar.bz2
gh-69998: Fix decoding error in locale.nl_langinfo() (GH-124963)
The function now sets temporarily the LC_CTYPE locale to the locale of the category that determines the requested value if the locales are different and the resulting string is non-ASCII. This temporary change affects other threads.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/locale.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/library/locale.rst b/Doc/library/locale.rst
index 0246f99..04035b3 100644
--- a/Doc/library/locale.rst
+++ b/Doc/library/locale.rst
@@ -314,6 +314,15 @@ The :mod:`locale` module defines the following exception and functions:
Get a representation of up to 100 values used to represent the values
0 to 99.
+ The function temporarily sets the ``LC_CTYPE`` locale to the locale
+ of the category that determines the requested value (``LC_TIME``,
+ ``LC_NUMERIC``, ``LC_MONETARY`` or ``LC_MESSAGES``) if locales are
+ different and the resulting string is non-ASCII.
+ This temporary change affects other threads.
+
+ .. versionchanged:: 3.14
+ The function now temporarily sets the ``LC_CTYPE`` locale in some cases.
+
.. function:: getdefaultlocale([envvars])