]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-93103: Py_DecodeLocale() uses _PyRuntime.preconfig (#93187)
authorVictor Stinner <vstinner@python.org>
Tue, 24 May 2022 22:09:48 +0000 (00:09 +0200)
committerGitHub <noreply@github.com>
Tue, 24 May 2022 22:09:48 +0000 (00:09 +0200)
commit32b7bcffba0e6f6c96d70cafbae1488c6bc36cbc
tree06c3c684b8b7bf7449be55d8b7f8f856cc74f99d
parentc7667a2d353cebb0287d29a3ead29b2107425b96
gh-93103: Py_DecodeLocale() uses _PyRuntime.preconfig (#93187)

The Py_DecodeLocale() and Py_EncodeLocale() now use
_PyRuntime.preconfig, rather than Py_UTF8Mode and
Py_LegacyWindowsFSEncodingFlag global configuration varibles, to
decide if the UTF-8 encoding is used or not.

As documented, these functions must not be called before Python is
preinitialized. The new PyConfig API should now be used, rather than
using deprecated functions like Py_SetPath() or PySys_SetArgv().
Python/fileutils.c
Python/preconfig.c