[issue44387] Not obvious that locale.LC_MESSAGES may not exist sometimes (e.g. on Windows)

2021-06-11 Thread Richard Mines
Richard Mines added the comment: 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:

[issue44387] Not obvious that locale.LC_MESSAGES may not exist sometimes (e.g. on Windows)

2021-06-10 Thread Jack DeVries
Jack DeVries added the comment: 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 */ -- ___ Python tracker

[issue44387] Not obvious that locale.LC_MESSAGES may not exist sometimes (e.g. on Windows)

2021-06-10 Thread Jack DeVries
Jack DeVries added the comment: Could it be that _locale throws an ImportError whenever LC_MESSAGES doesn't exist? Then, there are fall-backs defined here: https://github.com/python/cpython/blob/62f1d2b3d7dda99598d053e10b785c463fdcf591/Lib/locale.py#L45-L85 -- nosy: +jack__d

[issue44387] Not obvious that locale.LC_MESSAGES may not exist sometimes (e.g. on Windows)

2021-06-10 Thread Richard Mines
New submission from Richard Mines : Documentation page: https://docs.python.org/3/library/locale.html#locale.LC_MESSAGES Code comment saying that locale.LC_MESSAGES doesn't exist sometimes: https://github.com/python/cpython/blob/62f1d2b3d7dda99598d053e10b785c463fdcf591/Lib/locale.py#L25-L26