Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34.1k
gh-123853: Cleanup Windows 95 locale fallback support#144738
gh-123853: Cleanup Windows 95 locale fallback support#144738mokurin000 wants to merge 9 commits intopython:mainfrom
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
1 similar comment
This comment was marked as resolved.
This comment was marked as resolved.
ee5da1b to49f6613Compare This comment was marked as resolved.
This comment was marked as resolved.
mokurin000 commentedFeb 12, 2026
cc.@malemburg@serhiy-storchaka Hi! Could you take a look on these changes? |
1e06126 to2d24222CompareUh oh!
There was an error while loading.Please reload this page.
4f317a3 toaa0735bComparemalemburg commentedFeb 21, 2026
Are you sure that _locale._getdefaultlocale() will no longer return a Windows locale code ? |
mokurin000 commentedFeb 21, 2026 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
As far as I know, Looking into git blame, the fallback code was written at 26 years ago8f017a0, but it never get removed, and surprisingly the dictionary was maintained even after Windows 95 support were entirely removed0a86694 |
aa0735b toefd0a30Comparemalemburg commentedFeb 21, 2026
I think we should still leave a guard in the code, so that such codes do not leak outside the function. The guard should raise an exception and let the user know that something is wrong. Also, please have a look on Github whether the windows_locale is in use by Python 3 code. We may have to do a deprecation cycle (though it was already indirectly put through this as part of the now undone deprecation of getdefaultencoding()). |
mokurin000 commentedFeb 21, 2026 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
With the current mechanism, if any of
Okay, I will do so soon as have time |
mokurin000 commentedFeb 21, 2026 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Right, undocumented though, there are many code relying on the |
1ec8e64 to54e8f97CompareMost changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
mokurin000 commentedFeb 21, 2026
Now I believe it does no impact to python users, removed the NEWS entry |
54e8f97 to5b3e6bcCompareMost changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
serhiy-storchaka left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Should not_locale._getdefaultlocale() raise an exception if the locale is not found (this should never happen on modern Windows)?
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Also, `pyerrors.h` was included through `Python.h`, removing it
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
mokurin000 commentedFeb 26, 2026
I have made the requested changes; please review again |
Thanks for making the requested changes! @malemburg: please review the changes made to this pull request. |
serhiy-storchaka left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM. 👍
Modules/_localemodule.c Outdated
| } | ||
| /* cannot determine the language code (very unlikely) */ | ||
| Py_INCREF(Py_None); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
AFAIR, Py_BuildValue("O") takes care of the INCREF for you, so this should not be needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
See#145250.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
mokurin000 commentedFeb 27, 2026
I have made the requested changes; please review again |
Thanks for making the requested changes! @malemburg,@serhiy-storchaka: please review the changes made to this pull request. |
malemburg left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM, thanks,@mokurin000
Uh oh!
There was an error while loading.Please reload this page.
This removed the dead code
windows_localedict, as Windows introducedLOCALE_SISO639LANGNAMEandLOCALE_SISO3166CTRYNAMEsince Windows 98.Changes:
windows_localedict fromLib/locale.py0xfallback branch for Windows 95 or earlier inModules/_localemodule.cLib/locale.pylocale.windows_locale: Incorrect Windows locale for Cambodian #123853