Skip to content

[3.13] gh-69370: Fix "python -m inspect --details" for unencodable paths (GH-155246) - #156607

Merged
serhiy-storchaka merged 1 commit into
python:3.13from
serhiy-storchaka:backport-abf7a18-3.13
Aug 29, 2026
Merged

serhiy-storchaka merged 1 commit into
python:3.13from
serhiy-storchaka:backport-abf7a18-3.13

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Aug 29, 2026 •

Copy link
Copy Markdown
Member

It failed with UnicodeEncodeError if the path of the module contains characters unencodable in the encoding of sys.stdout, e.g. undecodable bytes of a file name. Such characters are now escaped with backslashes, unless stdout uses an error handler which can handle them.

(cherry picked from commit abf7a18)

test_details_undecodable_path() is added before test_details(), which is named test_details_option_with_package() in the main branch.

…hs (pythonGH-155246)

It failed with UnicodeEncodeError if the path of the module contains
characters unencodable in the encoding of sys.stdout, e.g. undecodable
bytes of a file name.  Such characters are now escaped with backslashes,
unless stdout uses an error handler which can handle them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit abf7a18)
@bedevere-app bedevere-app Bot added type-bug An unexpected behavior, bug, or error awaiting core review labels Aug 29, 2026
@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) August 29, 2026 19:56
@serhiy-storchaka
serhiy-storchaka merged commit c85549c into python:3.13 Aug 29, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant