GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||
GeezerVison is showing github.com — bpo-46659: Fix the MBCS codec alias on Windows by vstinner · Pull Request #31218 · python/cpython Conversation
|
|
@eryksun: Does this approach look good to you? It's basically restores Python 3.10 behavior. I just adjusted the test. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| self.assertEqual(codec.name, "mbcs") | ||
| # Check that looking up our 'default' codepage will return | ||
| # mbcs when we don't have a more specific one available | ||
| code_page = 9999 |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Let's use 99999 instead, which is beyond the range of anything that Python might ever define. See code page identifiers.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Yes, having a fallback for the process ANSI code page is for the best -- even though we support all of the known code pages in standard Windows locales. Thank you for clarifying the reason for its existence in the comments. I'd prefer to also have a fallback to "oem" for the process OEM code page, but adding |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @eryksun for your review. My use case is to deprecate the locale.getdefaultlocale() function. Adding an alias for the OEM page code is unrelated. If you consider that it's an useful feature, you can open a separated PR. So far, nobody requested it, so maybe it's not needed. I'm not convinced that the fallbak for the ANSI code page is used by anyone. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I don't know whether the ANSI fallback is used by anyone. As I said, I've never worked with supplemental/replacement custom locales. The suggestion can be shelved until someone has an issue or explicitly requests a fallback for OEM as something required for their work environment. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
It sounds perfectly reasonable :-) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.