◐ Shell
clean mode source ↗

[3.7] bpo-29571: Fix test_re.test_locale_flag() (GH-12099) by miss-islington · Pull Request #12108 · python/cpython

@miss-islington miss-islington commented

Feb 28, 2019

edited by bedevere-bot

Loading

Copy link Copy Markdown

Contributor

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 vstinner@redhat.com

https://bugs.python.org/issue29571