[issue46668] encodings: the "mbcs" alias doesn't work

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: commit ccbe8045faf6e63d36229ea4e1b9298572cda126 Author: Victor Stinner Date: Tue Feb 22 22:04:07 2022 +0100 bpo-46659: Fix the MBCS codec alias on Windows (GH-31218) -- resolution: -> fixed stage: patch review -> resolved status: open ->

[issue46668] encodings: the "mbcs" alias doesn't work

2022-02-08 Thread STINNER Victor
STINNER Victor added the comment: I created GH-31218 which basically restores Python 3.10 code but enhances the test. -- ___ Python tracker ___

[issue46668] encodings: the "mbcs" alias doesn't work

2022-02-07 Thread Eryk Sun
Eryk Sun added the comment: > I don't think that this fallback is needed anymore. Which Windows > code page can be used as ANSI code page which is not already > implemented as a Python codec? Python has full coverage of the ANSI and OEM code pages in the standard Windows locales, but I

[issue46668] encodings: the "mbcs" alias doesn't work

2022-02-07 Thread STINNER Victor
STINNER Victor added the comment: I don't think that this fallback is needed anymore. Which Windows code page can be used as ANSI code page which is not already implemented as a Python codec? -- ___ Python tracker

[issue46668] encodings: the "mbcs" alias doesn't work

2022-02-06 Thread Eryk Sun
Eryk Sun added the comment: > The Python 3.6 and 3.7 "codecs.register(_alias_mbcs)" doesn't work > because "search_function()" is tested before and it works for "cpXXX" > encodings. Isn't the 3.6-3.10 ordering of search_function() and _alias_mbcs() correct as a fallback? In this case,

[issue46668] encodings: the "mbcs" alias doesn't work

2022-02-06 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +29345 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31174 ___ Python tracker ___

[issue46668] encodings: the "mbcs" alias doesn't work

2022-02-06 Thread STINNER Victor
STINNER Victor added the comment: Python 3.11 supports the 40 code pages: * 037 * 273 * 424 * 437 * 500 * 720 * 737 * 775 * 850 * 852 * 855 * 856 * 857 * 858 * 860 * 861 * 862 * 863 * 864 * 865 * 866 * 869 * 874 * 875 * 932 * 949 * 950 * 1006 * 1026 * 1125 * 1140 * 1250 * 1251 * 1252 * 1253 *

[issue46668] encodings: the "mbcs" alias doesn't work

2022-02-06 Thread STINNER Victor
STINNER Victor added the comment: The alias was created in 2003 to fix bpo-671666: --- commit 4eab486476c0082087a8460a5ab1064e64cc1a6b Author: Martin v. Löwis Date: Mon Mar 3 09:34:01 2003 + Patch #671666: Alias ANSI code page to "mbcs". --- In 2003, bpo-671666 was created because

[issue46668] encodings: the "mbcs" alias doesn't work

2022-02-06 Thread STINNER Victor
New submission from STINNER Victor : While working on bpo-46659, I found a bug in the encodings "mbcs" alias. Even if the function has 2 tests (in test_codecs and test_site), both tests missed the bug :-( I fixed the alias with this change: --- commit 04dd60e50cd3da48fd19cdab4c0e4cc600d6af30