summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-05-15 12:27:16 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-05-15 12:27:16 (GMT)
commitb744ba1d14c5487576c95d0311e357b707600b47 (patch)
tree8730e891809884fd8b458b65e7d4bb26ebf6ef0e /Doc
parent06ba9ade85be733e4c6c3708c088317068ae20d9 (diff)
downloadcpython-b744ba1d14c5487576c95d0311e357b707600b47.zip
cpython-b744ba1d14c5487576c95d0311e357b707600b47.tar.gz
cpython-b744ba1d14c5487576c95d0311e357b707600b47.tar.bz2
Issue #8610: Load file system codec at startup, and display a fatal error on
failure. Set the file system encoding to utf-8 (instead of None) if getting the locale encoding failed, or if nl_langinfo(CODESET) function is missing.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/sys.rst12
1 files changed, 7 insertions, 5 deletions
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index cf15d8f..3b9bbb0 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -298,15 +298,13 @@ always available.
.. function:: getfilesystemencoding()
- Return the name of the encoding used to convert Unicode filenames into system
- file names, or ``None`` if the system default encoding is used. The result value
- depends on the operating system:
+ Return the name of the encoding used to convert Unicode filenames into
+ system file names. The result value depends on the operating system:
* On Mac OS X, the encoding is ``'utf-8'``.
* On Unix, the encoding is the user's preference according to the result of
- nl_langinfo(CODESET), or ``None`` if the ``nl_langinfo(CODESET)``
- failed.
+ nl_langinfo(CODESET), or ``'utf-8'`` if ``nl_langinfo(CODESET)`` failed.
* On Windows NT+, file names are Unicode natively, so no conversion is
performed. :func:`getfilesystemencoding` still returns ``'mbcs'``, as
@@ -316,6 +314,10 @@ always available.
* On Windows 9x, the encoding is ``'mbcs'``.
+ .. versionchanged:: 3.2
+ On Unix, use ``'utf-8'`` instead of ``None`` if ``nl_langinfo(CODESET)``
+ failed. :func:`getfilesystemencoding` result cannot be ``None``.
+
.. function:: getrefcount(object)