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

gh-123803: Support arbitrary code page encodings on Windows#123804

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

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedSep 7, 2024
edited by bedevere-appbot
Loading

If the cpXXX encoding is not directly implemented in Python, fall back to use the Windows-specific API codecs.code_page_encode() and codecs.code_page_decode().

If the cpXXX encoding is not directly implemented in Python, fall backto use the Windows-specific API codecs.code_page_encode() andcodecs.code_page_decode().
Copy link
Member

@zoobazooba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This change looks fine, and I can see now that it's not so trivial to raise a different exception. Maybe we can improve the current "unknown encoding" exception string to say "encoding '{name}' is not registered" or something that suggests it might be possible to fix by adding the encoding? I expect many users would think that encodings are static.

@bedevere-app
Copy link

When you're done making the requested changes, leave the comment:I have made the requested changes; please review again.

@serhiy-storchaka
Copy link
MemberAuthor

I have made the requested changes; please review again.

@bedevere-app
Copy link

Thanks for making the requested changes!

@malemburg: please review the changes made to this pull request.

Copy link
Member

@malemburgmalemburg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks,@serhiy-storchaka
This looks good now.

@serhiy-storchaka
Copy link
MemberAuthor

Thank you for your review@zooba and@malemburg. I do not particularly like the change in the error message. Can we do without it?

@zooba
Copy link
Member

I guess if people would rather wait and see if the difference in availability causes confusion, then we can do that. I'd prefer to be more clear in the docs, as I don't think developers or users currently expect codecs to be platform-specific like this.

@malemburg
Copy link
Member

Thank you for your review@zooba and@malemburg. I do not particularly like the change in the error message. Can we do without it?

How about "encoding XYZ not available" ?! I'd also be fine with leaving the current error message in place.

The "not registered" is not quite correct, since it assumes that there is a codec with that name available somewhere, it's just not registered. This is not always the case, though, e.g. if you mistype an encoding name.

@zooba
Copy link
Member

"Not registered" at least implies that there's a potential way to fix it, whereas "not available" suggests the user has to come to us to ask us to make it available. (I'd assume in this case they wouldn't read our docs either.)

"Not available on this platform" would be okay, but feels less accurate overall, since as you say a mistyped codec isn't going to be available on any platform. We can't seem to customise the message for a known-but-not-present codec though, so it's a bit of a tough spot.

@serhiy-storchakaserhiy-storchakaenabled auto-merge (squash)November 18, 2024 17:24
@serhiy-storchakaserhiy-storchaka merged commitf7ef020 intopython:mainNov 18, 2024
36 checks passed
@malemburg
Copy link
Member

Thanks,@serhiy-storchaka

@serhiy-storchakaserhiy-storchaka deleted the code-page-codecs branchNovember 20, 2024 16:48
ebonnal pushed a commit to ebonnal/cpython that referenced this pull requestJan 12, 2025
…thonGH-123804)If the cpXXX encoding is not directly implemented in Python, fall backto use the Windows-specific API codecs.code_page_encode() andcodecs.code_page_decode().
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@zoobazoobazooba left review comments

@malemburgmalemburgmalemburg approved these changes

@pablogsalpablogsalAwaiting requested review from pablogsal

@lysnikolaoulysnikolaouAwaiting requested review from lysnikolaou

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@serhiy-storchaka@zooba@malemburg

[8]ページ先頭

©2009-2025 Movatter.jp