Skip to content

gh-154582: Fix test_invalid_utf8_arg in non-UTF-8 multibyte locales#154584

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:cmdline-invalid-utf8-arg-locale
Jul 24, 2026
Merged

gh-154582: Fix test_invalid_utf8_arg in non-UTF-8 multibyte locales#154584
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:cmdline-invalid-utf8-arg-locale

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

Arbitrary bytes round-trip through surrogateescape only in UTF-8 and single-byte encodings, not in a stateful multibyte encoding such as EUC-JP. Skip the run_default and run_no_utf8_mode variants when their encoding is not lossless.

…ales

Arbitrary bytes round-trip through surrogateescape only in UTF-8 and
single-byte encodings, not in a stateful multibyte encoding such as EUC-JP.
Skip the run_default and run_no_utf8_mode variants when their encoding is
not lossless.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label Jul 24, 2026
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.13 bugs and security fixes label Jul 24, 2026
@serhiy-storchaka serhiy-storchaka added needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jul 24, 2026
@serhiy-storchaka
serhiy-storchaka requested a review from methane July 24, 2026 07:28
@serhiy-storchaka
serhiy-storchaka merged commit b1e530e into python:main Jul 24, 2026
59 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@serhiy-storchaka
serhiy-storchaka deleted the cmdline-invalid-utf8-arg-locale branch July 24, 2026 12:22
@miss-islington-app

Copy link
Copy Markdown

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker b1e530ebf3b68e884ab37882d690d95e5d82aef5 3.14

@bedevere-app

bedevere-app Bot commented Jul 24, 2026

Copy link
Copy Markdown

GH-154601 is a backport of this pull request to the 3.15 branch.

@miss-islington-app

Copy link
Copy Markdown

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker b1e530ebf3b68e884ab37882d690d95e5d82aef5 3.13

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 24, 2026
@bedevere-app

bedevere-app Bot commented Jul 24, 2026

Copy link
Copy Markdown

GH-154604 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jul 24, 2026
@bedevere-app

bedevere-app Bot commented Jul 24, 2026

Copy link
Copy Markdown

GH-154605 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jul 24, 2026
serhiy-storchaka added a commit that referenced this pull request Jul 24, 2026
…cales (GH-154584) (GH-154601)

Arbitrary bytes round-trip through surrogateescape only in UTF-8 and
single-byte encodings, not in a stateful multibyte encoding such as EUC-JP.
(cherry picked from commit b1e530e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
serhiy-storchaka added a commit that referenced this pull request Jul 24, 2026
…cales (GH-154584) (GH-154605)

Arbitrary bytes round-trip through surrogateescape only in UTF-8 and
single-byte encodings, not in a stateful multibyte encoding such as EUC-JP.
(cherry picked from commit b1e530e)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant