-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Not obvious that locale.LC_MESSAGES may not exist sometimes (e.g. on Windows) #88553
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
Comments
Documentation page: Code comment saying that locale.LC_MESSAGES doesn't exist sometimes: Lines 25 to 26 in 62f1d2b
Code fragment showing that locale.LC_MESSAGES can be non-existent: Lines 1747 to 1752 in 62f1d2b
Reading documentation it's not obvious that locale.LC_MESSAGES may not exist (e.g. Windows - Microsoft Store - Python 3.8) |
Could it be that _locale throws an ImportError whenever LC_MESSAGES doesn't exist? Then, there are fall-backs defined here: Lines 45 to 85 in 62f1d2b
|
Follow-up: nope! My hypothesis was incorrect. This is all that _localemodule.c has to say about LC_MESSAGES: #ifdef LC_MESSAGES
ADD_INT(module, LC_MESSAGES);
#endif /* LC_MESSAGES */ |
If you need a proof that it is possible that locale.LC_MESSAGES doesn't exist, I've attached a screenshot. Even more I'm showing that locale.LC_TIME may be equal to 5 which is a placeholder for locale.LC_MESSAGES if there is an ImportError: Line 57 in 62f1d2b
OS: Windows 10 20H2 |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: