Skip to content

Commit 916efb5

Browse files
Skip the test if undecodable paths are not supported
The file system can reject a name with undecodable bytes even if TESTFN_UNDECODABLE is not None (e.g. on macOS). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 0588ae6 commit 916efb5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Lib/test/test_inspect/test_inspect.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6591,7 +6591,10 @@ def test_details_undecodable_path(self):
65916591
# of stdout.
65926592
with temp_cwd() as test_dir:
65936593
subdir = os.path.join(os.fsencode(test_dir), TESTFN_UNDECODABLE)
6594-
os.mkdir(subdir)
6594+
try:
6595+
os.mkdir(subdir)
6596+
except OSError:
6597+
self.skipTest('undecodable paths are not supported')
65956598
with open(os.path.join(subdir, b'undecodable_mod.py'), 'w') as f:
65966599
f.write('"""Module docstring."""\n')
65976600
rc, out, err = assert_python_ok('-X', 'utf8=0', '-m', 'inspect',

0 commit comments

Comments
 (0)