mirror of
https://github.com/python/cpython.git
synced 2025-10-20 00:13:47 +00:00

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.
25 lines
363 B
C
25 lines
363 B
C
/* Minimal main program -- everything is loaded from the library */
|
|
|
|
#include "Python.h"
|
|
#include "internal/pystate.h"
|
|
#include <locale.h>
|
|
|
|
#ifdef __FreeBSD__
|
|
#include <fenv.h>
|
|
#endif
|
|
|
|
#ifdef MS_WINDOWS
|
|
int
|
|
wmain(int argc, wchar_t **argv)
|
|
{
|
|
return Py_Main(argc, argv);
|
|
}
|
|
#else
|
|
|
|
|
|
int
|
|
main(int argc, char **argv)
|
|
{
|
|
return _Py_UnixMain(argc, argv);
|
|
}
|
|
#endif
|