Skip to content

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

Open
serhiy-storchaka wants to merge 1 commit into
python:3.14from
serhiy-storchaka:backport-abf7a18-3.14
Open

[3.14] gh-69370: Fix "python -m inspect --details" for unencodable paths (GH-155246)#156606
serhiy-storchaka wants to merge 1 commit into
python:3.14from
serhiy-storchaka:backport-abf7a18-3.14

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant