summaryrefslogtreecommitdiffstats
path: root/Include/pylifecycle.h
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-12-16 03:54:22 (GMT)
committerGitHub <noreply@github.com>2017-12-16 03:54:22 (GMT)
commit9454060e84a669dde63824d9e2fcaf295e34f687 (patch)
tree4c40a6e1bd11aa75819acb7efce4981fc6ba7611 /Include/pylifecycle.h
parente796b2fe26f220107ac50667de6cc86c82b465e3 (diff)
downloadcpython-9454060e84a669dde63824d9e2fcaf295e34f687.zip
cpython-9454060e84a669dde63824d9e2fcaf295e34f687.tar.gz
cpython-9454060e84a669dde63824d9e2fcaf295e34f687.tar.bz2
bpo-29240, bpo-32030: Py_Main() re-reads config if encoding changes (#4899)
bpo-29240, bpo-32030: If the encoding change (C locale coerced or UTF-8 Mode changed), Py_Main() now reads again the configuration with the new encoding. Changes: * Add _Py_UnixMain() called by main(). * Rename pymain_free_pymain() to pymain_clear_pymain(), it can now be called multipled times. * Rename pymain_parse_cmdline_envvars() to pymain_read_conf(). * Py_Main() now clears orig_argc and orig_argv at exit. * Remove argv_copy2, Py_Main() doesn't modify argv anymore. There is no need anymore to get two copies of the wchar_t** argv. * _PyCoreConfig: add coerce_c_locale and coerce_c_locale_warn. * Py_UTF8Mode is now initialized to -1. * Locale coercion (PEP 538) now respects -I and -E options.
Diffstat (limited to 'Include/pylifecycle.h')
-rw-r--r--Include/pylifecycle.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Include/pylifecycle.h b/Include/pylifecycle.h
index dcb7fcb..3ea8ad6 100644
--- a/Include/pylifecycle.h
+++ b/Include/pylifecycle.h
@@ -105,6 +105,9 @@ PyAPI_FUNC(int) Py_FdIsInteractive(FILE *, const char *);
/* Bootstrap __main__ (defined in Modules/main.c) */
PyAPI_FUNC(int) Py_Main(int argc, wchar_t **argv);
+#ifdef Py_BUILD_CORE
+PyAPI_FUNC(int) _Py_UnixMain(int argc, char **argv);
+#endif
/* In getpath.c */
PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void);
@@ -194,7 +197,7 @@ PyAPI_FUNC(int) _PyOS_URandomNonblock(void *buffer, Py_ssize_t size);
/* Legacy locale support */
#ifndef Py_LIMITED_API
-PyAPI_FUNC(void) _Py_CoerceLegacyLocale(void);
+PyAPI_FUNC(void) _Py_CoerceLegacyLocale(const _PyCoreConfig *config);
PyAPI_FUNC(int) _Py_LegacyLocaleDetected(void);
PyAPI_FUNC(char *) _Py_SetLocaleFromEnv(int category);
#endif