Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-29240, bpo-32030: Py_Main() re-reads config if encoding changes #4899

Merged
merged 4 commits into from
Dec 16, 2017
Merged

bpo-29240, bpo-32030: Py_Main() re-reads config if encoding changes #4899

merged 4 commits into from
Dec 16, 2017

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Dec 16, 2017

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.

https://bugs.python.org/issue29240

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.
@vstinner vstinner changed the title Py_Main() re-reads config if encoding changes bpo-29240, bpo-32030: Py_Main() re-reads config if encoding changes Dec 16, 2017
* Update PYTHONCOERCECLOCALE doc
* Fix test_utf8_mode on macOS on Windows
@vstinner vstinner merged commit 9454060 into python:master Dec 16, 2017
@vstinner vstinner deleted the utf8_recode branch December 16, 2017 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants