Skip to content

[3.7] bpo-29571: Fix test_re.test_locale_flag() (GH-12099) #12108

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

Closed

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Feb 28, 2019

Use locale.getpreferredencoding() rather than locale.getlocale() to
get the locale encoding. With some locales, locale.getlocale()
returns the wrong encoding.

For example, on Fedora 29, locale.getlocale() returns ISO-8859-1
encoding for the "en_IN" locale, whereas
locale.getpreferredencoding() reports the correct encoding: UTF-8.
(cherry picked from commit ab71f8b)

Co-authored-by: Victor Stinner [email protected]

https://bugs.python.org/issue29571

Use locale.getpreferredencoding() rather than locale.getlocale() to
get the locale encoding. With some locales, locale.getlocale()
returns the wrong encoding.

For example, on Fedora 29, locale.getlocale() returns ISO-8859-1
encoding for the "en_IN" locale, whereas
locale.getpreferredencoding() reports the correct encoding: UTF-8.
(cherry picked from commit ab71f8b)

Co-authored-by: Victor Stinner <[email protected]>
@vstinner
Copy link
Member

Please don't merge this backport yet. Please wait until the modified test_re is run on Windows buildbot workers to ensure that it works as expected.

@miss-islington
Copy link
Contributor Author

@vstinner: Status check is done, and it's a failure ❌ .

1 similar comment
@miss-islington
Copy link
Contributor Author

@vstinner: Status check is done, and it's a failure ❌ .

@vstinner
Copy link
Member

vstinner commented Mar 5, 2019

A trivial backport doesn't work. I wrote PR #12178 to implement the proper fix.

@vstinner vstinner closed this Mar 5, 2019
@miss-islington miss-islington deleted the backport-ab71f8b-3.7 branch March 5, 2019 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants