PEP 540: don't mention locale.getpreferredencoding

Replace locale.getpreferredencoding() with "locale encoding" to avoid
confusion.
This commit is contained in:
Victor Stinner 2017-01-12 18:13:38 +01:00
parent 2f1e693eaa
commit 0966f373b6
1 changed files with 1 additions and 1 deletions

View File

@ -134,7 +134,7 @@ On FreeBSD and Solaris, ``nl_langinfo(CODESET)`` announces an alias of
the ASCII encoding, whereas ``mbstowcs()`` and ``wcstombs()`` functions
use the ISO 8859-1 encoding (Latin1) in practice. The problem is that
``os.fsencode()`` and ``os.fsdecode()`` use
``locale.getpreferredencoding()`` codec. For example, if command line
Python codec of the locale encoding. For example, if command line
arguments are decoded by ``mbstowcs()`` and encoded back by
``os.fsencode()``, an ``UnicodeEncodeError`` exception is raised instead
of retrieving the original byte string.