FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-64243: Implement `locale.getlocale` fall back in `gettext.find` by StanFromIreland · Pull Request #131477 · python/cpython · GitHub

Repository navigation

gh-64243: Implement locale.getlocale fall back in gettext.find - #131477

Open
StanFromIreland wants to merge 12 commits into
python:mainfrom
StanFromIreland:improve-find
Open

StanFromIreland wants to merge 12 commits into
python:mainfrom
StanFromIreland:improve-find

Conversation

StanFromIreland commented Mar 19, 2025 •
edited by github-actions Bot
Loading

Copy link
Copy Markdown
Member

LANGUAGES envvar is prioritized over getlocale for consistency with C gettext.


📚 Documentation preview 📚: https://cpython-previews--131477.org.readthedocs.build/

Copy link
Copy Markdown
Member Author

request: @tomasr8

Comment thread Lib/gettext.py Outdated
Comment thread Lib/gettext.py Outdated
Comment thread Lib/gettext.py Outdated
StanFromIreland requested a review from tomasr8 April 5, 2025 12:53

Copy link
Copy Markdown
Member Author

@serhiy-storchaka Could you please review this?

serhiy-storchaka self-requested a review April 30, 2025 18:57

serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

There are issues with using locale.getlocale(). It ignores the modifier and can raise ValueError. I suggest to use locale._setlocale().

Needed tests for locales "C", "C.UTF-8", locales with a modifier, locales with and without encoding.

To help testing, you can extract the code into the _guess_languages() function.

Comment thread Lib/gettext.py
Comment thread Lib/gettext.py

Copy link
Copy Markdown
Member Author

There are several existing tests (from a previous pr) for the C locale.

Comment thread Doc/library/gettext.rst Outdated
Comment thread Lib/test/test_gettext.py Outdated
Comment thread Lib/test/test_gettext.py Outdated
Comment thread Lib/test/test_gettext.py Outdated
Comment thread Lib/test/test_gettext.py Outdated
StanFromIreland marked this pull request as draft June 19, 2025 15:40

Copy link
Copy Markdown
Member Author

CIs don’t have some locale, I will have to add requirements.

StanFromIreland marked this pull request as ready for review June 19, 2025 16:38

Copy link
Copy Markdown
Member Author

@tomasr8 as the expert now, could I get a review:-)

tomasr8 commented Jun 25, 2025

Copy link
Copy Markdown
Member

I can have a look this weekend, though I'd still prefer to get a final signoff from Serhiy :)

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 22, 2026
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

Labels

awaiting review stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL