{{ message }}
gh-69998: Fix decoding error in locale.nl_langinfo()#124963
Merged
serhiy-storchaka merged 4 commits intoOct 8, 2024
Merged
Conversation
The function now sets temporarily the LC_CTYPE locale to the locale of the category that determines the requested value if the locales are different and the resulting string is non-ASCII. This temporary change affects other threads.
vstinner
approved these changes
Oct 4, 2024
vstinner
left a comment
Member
There was a problem hiding this comment.
LGTM. I wrote a similar change in the past using _Py_GetLocaleconvNumeric(). It's used for example in Python/formatter_unicode.c to get the decimal point and thousands separator.
Sorry, something went wrong.
vstinner
reviewed
Oct 4, 2024
vstinner
approved these changes
Oct 7, 2024
vstinner
left a comment
Member
There was a problem hiding this comment.
LGTM with a single call to nl_langinfo().
Sorry, something went wrong.
efimov-mikhail
pushed a commit
to efimov-mikhail/cpython
that referenced
this pull request
Oct 9, 2024
…124963) The function now sets temporarily the LC_CTYPE locale to the locale of the category that determines the requested value if the locales are different and the resulting string is non-ASCII. This temporary change affects other threads.
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
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.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.
The function now sets temporarily the LC_CTYPE locale to the locale of the category that determines the requested value if the locales are different and the resulting string is non-ASCII.
This temporary change affects other threads.
📚 Documentation preview 📚: https://cpython-previews--124963.org.readthedocs.build/