diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2012-06-05 23:37:37 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2012-06-05 23:37:37 (GMT) |
commit | a01f1adb87c71d9fbd07334f00bd94e106b9ad43 (patch) | |
tree | 3dd32b1a6e0ff49d6cb60ec89b9f001c7d6481ef /Doc/library | |
parent | 187aa545165d8d5eac222ecce29c8a77e0282dd4 (diff) | |
download | cpython-a01f1adb87c71d9fbd07334f00bd94e106b9ad43.zip cpython-a01f1adb87c71d9fbd07334f00bd94e106b9ad43.tar.gz cpython-a01f1adb87c71d9fbd07334f00bd94e106b9ad43.tar.bz2 |
Close #6203: Document that Python 3 sets LC_CTYPE at startup to the user's preferred locale encoding
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/locale.rst | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Doc/library/locale.rst b/Doc/library/locale.rst index 45aba0a..d46f1cf 100644 --- a/Doc/library/locale.rst +++ b/Doc/library/locale.rst @@ -475,8 +475,11 @@ in such a way that frequent locale changes may cause core dumps. This makes the locale somewhat painful to use correctly. Initially, when a program is started, the locale is the ``C`` locale, no matter -what the user's preferred locale is. The program must explicitly say that it -wants the user's preferred locale settings by calling ``setlocale(LC_ALL, '')``. +what the user's preferred locale is. There is one exception: the +:data:`LC_CTYPE` category is changed at startup to set the current locale +encoding to the user's preferred locale encoding. The program must explicitly +say that it wants the user's preferred locale settings for other categories by +calling ``setlocale(LC_ALL, '')``. It is generally a bad idea to call :func:`setlocale` in some library routine, since as a side effect it affects the entire program. Saving and restoring it |