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-34485: Fix _Py_InitializeCore() for C locale coercion #8979

Merged
merged 1 commit into from
Aug 28, 2018
Merged

bpo-34485: Fix _Py_InitializeCore() for C locale coercion #8979

merged 1 commit into from
Aug 28, 2018

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Aug 28, 2018

  • _Py_InitializeCore() now sets the LC_CTYPE locale to the user
    preferred locale before checking if the C locale should be coerced
    or not in _PyCoreConfig_Read().
  • Fix pymain_read_conf(): remember if the C locale has been coerced
    when the configuration should be read again if the encoding has
    changed.

https://bugs.python.org/issue34485

* _Py_InitializeCore() now sets the LC_CTYPE locale to the user
  preferred locale before checking if the C locale should be coerced
  or not in _PyCoreConfig_Read().
* Fix pymain_read_conf(): remember if the C locale has been coerced
  when the configuration should be read again if the encoding has
  changed.
@vstinner
Copy link
Member Author

Technically, it's not really a bugfix: it just avoids to call a function which does nothing, when it's not needed to coerce the C locale. So I didn't add a NEWS entry.

@vstinner vstinner merged commit 2c8ddcf into python:master Aug 28, 2018
@miss-islington
Copy link
Contributor

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@vstinner vstinner deleted the setlocale branch August 28, 2018 22:16
@miss-islington
Copy link
Contributor

Sorry, @vstinner, I could not cleanly backport this to 3.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 2c8ddcf4f14f3e4c87a6fe6678ab5ad09130c6ab 3.7

@bedevere-bot
Copy link

GH-8981 is a backport of this pull request to the 3.7 branch.

vstinner added a commit that referenced this pull request Aug 28, 2018
…H-8981)

* _Py_InitializeCore() now sets the LC_CTYPE locale to the user
  preferred locale before checking if the C locale should be coerced
  or not in _PyCoreConfig_Read().
* Fix pymain_read_conf(): remember if the C locale has been coerced
  when the configuration should be read again if the encoding has
  changed.

(cherry picked from commit 2c8ddcf)
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.

4 participants