diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-09-17 18:01:39 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-17 18:01:39 -0700 |
commit | 144f1e2c6f4a24bd288c045986842c65cc289684 (patch) | |
tree | 26220394766aa9b5cdfbd9579e5e0ebb5b1f70d4 /Programs | |
parent | 512d7101098b971837cbb406942215244f636547 (diff) | |
download | cpython-git-144f1e2c6f4a24bd288c045986842c65cc289684.tar.gz |
[3.7] bpo-34589: Add -X coerce_c_locale option; C locale coercion off by default (GH-9379)
* bpo-34589: Make _PyCoreConfig.coerce_c_locale private (GH-9371)
_PyCoreConfig:
* Rename coerce_c_locale to _coerce_c_locale
* Rename coerce_c_locale_warn to _coerce_c_locale_warn
These fields are now private (name prefixed by "_").
(cherry picked from commit 188ebfa475a6f6aa2d0ea14ca8e1fbe7865b6d27)
* bpo-34589: C locale coercion off by default (GH-9073)
Py_Initialize() and Py_Main() cannot enable the C locale coercion
(PEP 538) anymore: it is always disabled. It can now only be enabled
by the Python program ("python3).
test_embed: get_filesystem_encoding() doesn't have to set PYTHONUTF8
nor PYTHONCOERCECLOCALE, these variables are already set in the
parent.
(cherry picked from commit 7a0791b6992d420dc52536257f2f093851ed7215)
* bpo-34589: Add -X coerce_c_locale command line option (GH-9378)
Add a new -X coerce_c_locale command line option to control C locale
coercion (PEP 538).
(cherry picked from commit dbdee0073cf0b88fe541980ace1f650900f455cc)
Diffstat (limited to 'Programs')
-rw-r--r-- | Programs/_testembed.c | 9 | ||||
-rw-r--r-- | Programs/python.c | 2 |
2 files changed, 4 insertions, 7 deletions
diff --git a/Programs/_testembed.c b/Programs/_testembed.c index 6c35f9586b..029f6ad4b6 100644 --- a/Programs/_testembed.c +++ b/Programs/_testembed.c @@ -328,8 +328,8 @@ dump_config(void) printf("dump_refs = %i\n", config->dump_refs); printf("malloc_stats = %i\n", config->malloc_stats); - printf("coerce_c_locale = %i\n", config->coerce_c_locale); - printf("coerce_c_locale_warn = %i\n", config->coerce_c_locale_warn); + printf("_coerce_c_locale = %i\n", config->_coerce_c_locale); + printf("_coerce_c_locale_warn = %i\n", config->_coerce_c_locale_warn); printf("utf8_mode = %i\n", config->utf8_mode); printf("program_name = %ls\n", config->program_name); @@ -473,8 +473,6 @@ static int test_init_from_config(void) putenv("PYTHONMALLOCSTATS=0"); config.malloc_stats = 1; - /* FIXME: test coerce_c_locale and coerce_c_locale_warn */ - putenv("PYTHONUTF8=0"); Py_UTF8Mode = 0; config.utf8_mode = 1; @@ -544,8 +542,7 @@ static int test_init_isolated(void) /* Test _PyCoreConfig.isolated=1 */ _PyCoreConfig config = _PyCoreConfig_INIT; - /* Set coerce_c_locale and utf8_mode to not depend on the locale */ - config.coerce_c_locale = 0; + /* Set utf8_mode to not depend on the locale */ config.utf8_mode = 0; /* Use path starting with "./" avoids a search along the PATH */ config.program_name = L"./_testembed"; diff --git a/Programs/python.c b/Programs/python.c index 78e48f800c..c7697facbe 100644 --- a/Programs/python.c +++ b/Programs/python.c @@ -6,7 +6,7 @@ int wmain(int argc, wchar_t **argv) { - return Py_Main(argc, argv); + return _Py_WindowsMain(argc, argv); } #else int |