diff options
author | Inada Naoki <songofacandy@gmail.com> | 2022-04-22 01:39:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-22 01:39:24 (GMT) |
commit | 1317b70f89606bd14597116b7ab68a968ea6c017 (patch) | |
tree | 84cefd08afe31ffeb3f7a1f7ad1c9d2688abb168 /Doc/library/os.rst | |
parent | efe7fd4170bb809ed46cac35c6a9007d5b794e7e (diff) | |
download | cpython-1317b70f89606bd14597116b7ab68a968ea6c017.zip cpython-1317b70f89606bd14597116b7ab68a968ea6c017.tar.gz cpython-1317b70f89606bd14597116b7ab68a968ea6c017.tar.bz2 |
gh-91156: Use `locale.getencoding()` instead of getpreferredencoding (GH-91732)
Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Doc/library/os.rst')
-rw-r--r-- | Doc/library/os.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst index c22bf56..471890e 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -105,15 +105,15 @@ of the UTF-8 encoding: * Use UTF-8 as the :term:`filesystem encoding <filesystem encoding and error handler>`. -* :func:`sys.getfilesystemencoding()` returns ``'UTF-8'``. -* :func:`locale.getpreferredencoding()` returns ``'UTF-8'`` (the *do_setlocale* +* :func:`sys.getfilesystemencoding()` returns ``'utf-8'``. +* :func:`locale.getpreferredencoding()` returns ``'utf-8'`` (the *do_setlocale* argument has no effect). * :data:`sys.stdin`, :data:`sys.stdout`, and :data:`sys.stderr` all use UTF-8 as their text encoding, with the ``surrogateescape`` :ref:`error handler <error-handlers>` being enabled for :data:`sys.stdin` and :data:`sys.stdout` (:data:`sys.stderr` continues to use ``backslashreplace`` as it does in the default locale-aware mode) -* On Unix, :func:`os.device_encoding` returns ``'UTF-8'`` rather than the +* On Unix, :func:`os.device_encoding` returns ``'utf-8'`` rather than the device encoding. Note that the standard stream settings in UTF-8 mode can be overridden by |