Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented May 20, 2019

  • Fix _Py_LegacyLocaleDetected(): don't attempt to coerce the
    C locale if LC_ALL environment variable is set. Add 'warn'
    parameter: emit_stderr_warning_for_legacy_locale() must check for
    the LC_ALL env var.
  • _PyPreConfig_Write() sets coerce_c_locale to 0 if
    _Py_CoerceLegacyLocale() fails.

Altogether, _PyRuntime.preconfig.coerce_c_locale can now be used to
check if the C locale has been coerced.

https://bugs.python.org/issue36763

* Fix _Py_LegacyLocaleDetected(): don't attempt to coerce the
  C locale if LC_ALL environment variable is set. Add 'warn'
  parameter: emit_stderr_warning_for_legacy_locale() must check for
  the LC_ALL env var.
* _PyPreConfig_Write() sets coerce_c_locale to 0 if
  _Py_CoerceLegacyLocale() fails.

Altogether, _PyRuntime.preconfig.coerce_c_locale can now be used to
check if the C locale has been coerced.
@vstinner
Copy link
Member Author

cc @ncoghlan: this PR doesn't change the Python behavior, it only changes _PyRuntime.preconfig.coerce_c_locale when LC_ALL env var is set, or if coercion the C locale fails. _PyRuntime.preconfig.coerce_c_locale is set to 0 in this case, instead of 2.

@vstinner vstinner merged commit 0f72147 into python:master May 20, 2019
@vstinner vstinner deleted the coerce_c_locale branch May 20, 2019 15:16
@ncoghlan
Copy link
Contributor

@vstinner Makes sense, thanks.

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