Skip to content

Commit 5ee9f1d

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 07a943e commit 5ee9f1d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Lib/test/test_pydoc/test_pydoc.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,10 @@ def test_html_doc_undecodable_path(self):
10321032
with os_helper.temp_cwd() as test_dir:
10331033
subdir = os.path.join(os.fsencode(test_dir),
10341034
os_helper.TESTFN_UNDECODABLE)
1035-
os.mkdir(subdir)
1035+
try:
1036+
os.mkdir(subdir)
1037+
except OSError:
1038+
self.skipTest('undecodable paths are not supported')
10361039
with open(os.path.join(subdir, b'undecodable_mod.py'), 'w') as f:
10371040
f.write('"""Module docstring."""\n')
10381041
with import_helper.DirsOnSysPath(os.fsdecode(subdir)):

0 commit comments

Comments
 (0)