cpython/Python
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
..
clinic bpo-36127: Argument Clinic: inline parsing code for keyword parameters. (GH-12058) 2019-03-14 10:32:22 +02:00
_warnings.c bpo-35459: Use PyDict_GetItemWithError() instead of PyDict_GetItem(). (GH-11112) 2019-02-25 17:59:46 +02:00
asdl.c
ast.c bpo-36332: Allow compile() to handle AST objects with assignment expressions (GH-12398) 2019-03-18 13:51:53 +00:00
ast_opt.c
ast_unparse.c
bltinmodule.c bpo-35975: Support parsing earlier minor versions of Python 3 (GH-12086) 2019-03-07 12:38:08 -08:00
bootstrap_hash.c
ceval.c bpo-36370: Check for PyErr_Occurred() after PyImport_GetModule() (GH-12504) 2019-03-25 21:50:58 +01:00
ceval_gil.h Revert: bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). (GH-11617) (GH-12159) 2019-03-04 14:21:28 +01:00
codecs.c bpo-35459: Use PyDict_GetItemWithError() instead of PyDict_GetItem(). (GH-11112) 2019-02-25 17:59:46 +02:00
compile.c bpo-35284: Fix the error handling in the compiler's compiler_call(). (GH-10625) 2019-03-22 09:30:32 +02:00
condvar.h bpo-12822: use monotonic clock for condvar if possible (GH-11723) 2019-02-20 10:00:09 +09:00
context.c bpo-36101: remove non-ascii characters in docstring (GH-12018) 2019-02-25 08:18:48 +09:00
coreconfig.c bpo-36444: Rework _Py_InitializeFromConfig() API (GH-12576) 2019-03-27 13:40:14 +01:00
dtoa.c bpo-36262: Fix _Py_dg_strtod() memory leak (goto undfl) (GH-12276) 2019-03-13 17:55:01 +01:00
dup2.c
dynamic_annotations.c
dynload_aix.c
dynload_dl.c
dynload_hpux.c
dynload_shlib.c
dynload_stub.c
dynload_win.c bpo-36254: Fix invalid uses of %d in format strings in C. (GH-12264) 2019-03-13 22:59:55 +02:00
errors.c bpo-35459: Use PyDict_GetItemWithError() instead of PyDict_GetItem(). (GH-11112) 2019-02-25 17:59:46 +02:00
fileutils.c bpo-36352: Avoid hardcoded MAXPATHLEN size in getpath.c (GH-12423) 2019-03-19 02:58:14 +01:00
formatter_unicode.c
frozen.c
frozenmain.c bpo-36444: Rework _Py_InitializeFromConfig() API (GH-12576) 2019-03-27 13:40:14 +01:00
future.c
getargs.c bpo-36381: warn when no PY_SSIZE_T_CLEAN defined (GH-12473) 2019-03-23 21:04:40 +09:00
getcompiler.c
getcopyright.c
getopt.c bpo-36301: Add _PyWstrList structure (GH-12343) 2019-03-15 15:08:05 +01:00
getplatform.c
getversion.c
graminit.c Remove d_initial from the parser as it is unused (GH-12212) 2019-03-09 15:35:50 +00:00
hamt.c bpo-36254: Fix invalid uses of %d in format strings in C. (GH-12264) 2019-03-13 22:59:55 +02:00
import.c bpo-36370: Check for PyErr_Occurred() after PyImport_GetModule() (GH-12504) 2019-03-25 21:50:58 +01:00
importdl.c
importdl.h
importlib.h bpo-35321: Set the spec origin to frozen in frozen modules (#11732) 2019-02-04 16:56:26 -08:00
importlib_external.h bpo-35843: Implement __getitem__ for _NamespacePath (GH-11690) 2019-03-08 10:58:00 -08:00
importlib_zipimport.h
makeopcodetargets.py
marshal.c
modsupport.c bpo-36381: warn when no PY_SSIZE_T_CLEAN defined (GH-12473) 2019-03-23 21:04:40 +09:00
mysnprintf.c
mystrtoul.c
opcode_targets.h
pathconfig.c bpo-36301: Cleanup preconfig.c and coreconfig.c (GH-12563) 2019-03-26 16:58:50 +01:00
peephole.c
preconfig.c bpo-36443: Disable C locale coercion and UTF-8 Mode by default (GH-12589) 2019-03-27 18:28:46 +01:00
pyarena.c bpo-36254: Fix invalid uses of %d in format strings in C. (GH-12264) 2019-03-13 22:59:55 +02:00
pyctype.c
pyfpe.c
pyhash.c
pylifecycle.c bpo-36443: Disable C locale coercion and UTF-8 Mode by default (GH-12589) 2019-03-27 18:28:46 +01:00
pymath.c
pystate.c bpo-36444: Remove _PyMainInterpreterConfig (GH-12571) 2019-03-27 01:36:16 +01:00
pystrcmp.c
pystrhex.c
pystrtod.c
Python-ast.c bpo-36280: Add Constant.kind field (GH-12295) 2019-03-13 13:00:46 -07:00
pythonrun.c bpo-35975: Support parsing earlier minor versions of Python 3 (GH-12086) 2019-03-07 12:38:08 -08:00
pytime.c
README
strdup.c
structmember.c
symtable.c bpo-36187: Remove NamedStore. (GH-12167) 2019-03-05 20:42:06 +02:00
sysmodule.c bpo-36447, bpo-36447: Fix refleak in _PySys_InitMain() (GH-12586) 2019-03-27 13:43:47 +01:00
thread.c
thread_nt.h
thread_pthread.h bpo-12822: use monotonic clock for condvar if possible (GH-11723) 2019-02-20 10:00:09 +09:00
traceback.c
wordcode_helpers.h

Miscellaneous source files for the main Python shared library