Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mdist: correctly detect dirty hg repos with non-English locale, redux #13693

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eli-schwartz
Copy link
Member

https://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html

GNU Gettext defines a feature, whereby for translation purposes, if LC_ALL / LANG are not set to C, but rather define an active translation, the LANGUAGE variable can be used to specify fallback languages in a colon-separated list wherein the first option is the primary language and the rest are fallbacks.

CPython, instead, checks the LANGUAGE variable first, and the first variable that has a non-null value is treated as the canonical language specification, splitted, and iterated over. LC_ALL=C is therefore totally ignored, which is a major problem, and the variables aren't checked for consistency, which is a less major problem.

Thus, we sanitize the environment even harder. What an absolute disaster. Even if this was fixed tomorrow we would need to maintain this hack until 2030.

Bug: https://bugs.gentoo.org/936670

https://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html

GNU Gettext defines a feature, whereby for translation purposes, if
LC_ALL / LANG are *not* set to C, but rather define an active
translation, the LANGUAGE variable can be used to specify fallback
languages in a colon-separated list wherein the first option is the
primary language and the rest are fallbacks.

CPython, instead, checks the LANGUAGE variable first, and the first
variable that has a non-null value is treated as the canonical language
specification, splitted, and iterated over. LC_ALL=C is therefore
totally ignored, which is a major problem, and the variables aren't
checked for consistency, which is a less major problem.

Thus, we sanitize the environment even harder. What an absolute
disaster. Even if this was fixed tomorrow we would need to maintain this
hack until 2030.

Bug: https://bugs.gentoo.org/936670
@eli-schwartz eli-schwartz added this to the 1.5.2 milestone Sep 20, 2024
@eli-schwartz
Copy link
Member Author

Based on further research, the remediation is correct but the commit message could use a bit more nuance. CPython didn't invent this behavior, even though it is broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant