Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-46659: Fix the MBCS codec alias on Windows#31218

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vstinner merged 2 commits intopython:mainfromvstinner:mbcs_alias2
Feb 22, 2022
Merged

bpo-46659: Fix the MBCS codec alias on Windows#31218

vstinner merged 2 commits intopython:mainfromvstinner:mbcs_alias2
Feb 22, 2022

Conversation

vstinner
Copy link
Member

@vstinnervstinner commentedFeb 8, 2022
edited by bedevere-bot
Loading

@vstinner
Copy link
MemberAuthor

@eryksun: Does this approach look good to you? It's basically restores Python 3.10 behavior. I just adjusted the test.

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
Copy link
Contributor

Choose a reason for 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. Seecode page identifiers.

@eryksun
Copy link
Contributor

eryksun commentedFeb 8, 2022
edited
Loading

Does this approach look good to you? It's basically restores Python 3.10 behavior. I just adjusted the test.

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_winapi.GetOEMCP() is an enhancement request.

@vstinnervstinner merged commitccbe804 intopython:mainFeb 22, 2022
@vstinnervstinner deleted the mbcs_alias2 branchFebruary 22, 2022 21:04
@vstinner
Copy link
MemberAuthor

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.

@eryksun
Copy link
Contributor

I'm not convinced that the fallbak for the ANSI code page is used by anyone.

I don't know whether the ANSI fallback is used by anyone. As I said, I've never worked with supplemental/replacementcustom 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.

@vstinner
Copy link
MemberAuthor

The suggestion can be shelved until someone has an issue or explicitly requests a fallback for OEM as something required for their work environment.

It sounds perfectly reasonable :-)

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@eryksuneryksuneryksun left review comments

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@vstinner@eryksun@the-knights-who-say-ni@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp