Fix the test that broke after 3.12 changes to locale.normalize#328
Closed
kkalinowski-reef wants to merge 6 commits into
Closed
Fix the test that broke after 3.12 changes to locale.normalize#328kkalinowski-reef wants to merge 6 commits into
locale.normalize#328kkalinowski-reef wants to merge 6 commits into
Conversation
- 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 converting `C.UTF-8` into `en_US.UTF-8`. If you normalized the locale string, it was impossible to set `C.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.
mjurbanski-reef
approved these changes
Dec 4, 2023
| @@ -0,0 +1 @@ | |||
| Fixed tests failing because of changes made to `locale.normalize` in Python 3.12. | |||
There was a problem hiding this comment.
afaik these filenames are supposed to be prepended with + when not refering to issue numbers https://github.com/reef-technologies/b2-sdk-python/blob/master/CONTRIBUTING.md#changelog
Author
There was a problem hiding this comment.
Thanks for pointing that out – I missed that part.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
locale.normalizewas convertingC.UTF-8intoen_US.UTF-8. If you normalized the locale string, it was impossible to setC.UTF-8;C.UTF-8maps to itself;localeworks on duct tape for some time now) ;C.UTF-8doesn't seem to be used anywhere else in the codebase, except for this one test;locale.locale_aliasdictionary for certain platforms. However, this is part of the private implementation and could change without prior notice;