gh-74940: Allow fallback to UTF-8 encoding on systems with no locales installed. by gordonmessmer · Pull Request #14925 · python/cpython (original) (raw)
mjurbanski-reef pushed a commit to Backblaze/b2-sdk-python that referenced this pull request
- Fix the test that broke after 3.12 changes to locale.normalize
- On Linux, C.UTF-8 locale is now part of the standard. macOS and Windows use en_US.UTF-8 instead.
- Up to 3.11,
locale.normalize
was convertingC.UTF-8
intoen_US.UTF-8
. If you normalized the locale string, it was impossible to setC.UTF-8
. - In 3.12,
C.UTF-8
maps to itself. - python/cpython#14925
- https://peps.python.org/pep-0538/
C.UTF-8
doesn't seem to be used anywhere else in the codebase, except for this one test.- Other fix would be to inject a previous value to
locale.locale_alias
dictionary for certain platforms. However, this is part of the private implementation and could change without prior notice. - More changes to the locale are scheduled for 3.15.
Format applied
Added changelog entry for towncrier
Prepended + to the changelog filename, as it's not closing any GitHub ticket
Removed TODO mentioning a broken locale in CI
Re-enabled 3.12 test matrix for both Windows and macOS