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

[3.7] bpo-34527: POSIX locale enables the UTF-8 Mode (GH-8972) #8974

Merged
merged 1 commit into from Aug 28, 2018
Merged

[3.7] bpo-34527: POSIX locale enables the UTF-8 Mode (GH-8972) #8974

merged 1 commit into from Aug 28, 2018

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Aug 28, 2018

  • The UTF-8 Mode is now also enabled by the "POSIX" locale, not only
    by the "C" locale.
  • On FreeBSD, Py_DecodeLocale() and Py_EncodeLocale() now also forces
    the ASCII encoding if the LC_CTYPE locale is "POSIX", not only if
    the LC_CTYPE locale is "C".
  • test_utf8_mode.test_cmd_line() checks also that the command line
    arguments are decoded from UTF-8 when the the UTF-8 Mode is enabled
    with POSIX locale or C locale.

(cherry picked from commit 5cb2589)

https://bugs.python.org/issue34527

* The UTF-8 Mode is now also enabled by the "POSIX" locale, not only
  by the "C" locale.
* On FreeBSD, Py_DecodeLocale() and Py_EncodeLocale() now also forces
  the ASCII encoding if the LC_CTYPE locale is "POSIX", not only if
  the LC_CTYPE locale is "C".
* test_utf8_mode.test_cmd_line() checks also that the command line
  arguments are decoded from UTF-8 when the the UTF-8 Mode is enabled
  with POSIX locale or C locale.

(cherry picked from commit 5cb2589)
@vstinner
Copy link
Member Author

I tested manually this change on FreeBSD with multiple locale setup: LC_ALL=POSIX, LC_CTYPE=C, etc. All tests pass.

@vstinner vstinner merged commit 65ef742 into python:3.7 Aug 28, 2018
@vstinner vstinner deleted the posix_locale37 branch August 28, 2018 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants