Skip to content

gh-82052: Don't send partial UTF-8 sequences to the Windows API #101103

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 17, 2023

Conversation

pfmoore
Copy link
Member

@pfmoore pfmoore commented Jan 17, 2023

Fixes #82052

This doesn't include a test, as I'm not sure how I would write a test for it. The only reproducer I am aware of involves sending output to the console screen and visually inspecting it. I've validated that this PR fixes the issue by doing that test, but it's not something I know how to automate.

@zooba
Copy link
Member

zooba commented Jan 17, 2023

Yeah, I don't think this can be tested without mocking native APIs. And while I think we can do that now (for console stuff), we don't have the infrastructure set up for it, and no need to add it for this.

I approve this, so merge whenever you're happy.

@zooba zooba added needs backport to 3.10 only security fixes needs backport to 3.11 only security fixes labels Jan 17, 2023
@pfmoore pfmoore merged commit f34176b into python:main Jan 17, 2023
@miss-islington
Copy link
Contributor

Thanks @pfmoore for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒⛏🤖

@pfmoore pfmoore deleted the mojibake_issue branch January 17, 2023 19:23
@bedevere-bot
Copy link

GH-101107 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Jan 17, 2023
@bedevere-bot
Copy link

GH-101108 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Jan 17, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 17, 2023
…pythonGH-101103)

Don't send partial UTF-8 sequences to the Windows API
(cherry picked from commit f34176b)

Co-authored-by: Paul Moore <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 17, 2023
…pythonGH-101103)

Don't send partial UTF-8 sequences to the Windows API
(cherry picked from commit f34176b)

Co-authored-by: Paul Moore <[email protected]>
miss-islington added a commit that referenced this pull request Jan 17, 2023
…01103)

Don't send partial UTF-8 sequences to the Windows API
(cherry picked from commit f34176b)

Co-authored-by: Paul Moore <[email protected]>
miss-islington added a commit that referenced this pull request Jan 17, 2023
…01103)

Don't send partial UTF-8 sequences to the Windows API
(cherry picked from commit f34176b)

Co-authored-by: Paul Moore <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows: WindowsConsoleIO produces mojibake for strings longer than 32 KiB
4 participants