cpython/Misc/NEWS.d/next/C API
Victor Stinner d929f1838a
bpo-36443: Disable C locale coercion and UTF-8 Mode by default (GH-12589)
bpo-36443, bpo-36202: Since Python 3.7.0, calling Py_DecodeLocale()
before Py_Initialize() produces mojibake if the LC_CTYPE locale is
coerced and/or if the UTF-8 Mode is enabled by the user
configuration. This change fix the issue by disabling LC_CTYPE
coercion and UTF-8 Mode by default. They must now be enabled
explicitly (opt-in) using the new _Py_PreInitialize() API with
_PyPreConfig.

When embedding Python, set coerce_c_locale and utf8_mode attributes
of _PyPreConfig to -1 to enable automatically these parameters
depending on the LC_CTYPE locale, environment variables and command
line arguments

Alternative: Setting Py_UTF8Mode to 1 always explicitly enables the
UTF-8 Mode.

Changes:

* _PyPreConfig_INIT now sets coerce_c_locale and utf8_mode to 0 by
  default.
* _Py_InitializeFromArgs() and _Py_InitializeFromWideArgs() can now
  be called with config=NULL.
2019-03-27 18:28:46 +01:00
..
2019-01-23-12-38-11.bpo-35810.wpbWeb.rst bpo-35810: Incref heap-allocated types in PyObject_Init (GH-11661) 2019-03-27 12:52:18 +01:00
2019-03-27-15-58-23.bpo-36443.tAfZR9.rst bpo-36443: Disable C locale coercion and UTF-8 Mode by default (GH-12589) 2019-03-27 18:28:46 +01:00
README.rst Link to blurb on PyPI in the NEWS.d READMEs. (#3323) 2017-09-05 10:38:05 -07:00

README.rst

Put news entry `blurb`_ files for the *C API* section in this directory.

.. _blurb: https://pypi.org/project/blurb/