Skip to content

Commit e0acec1

Browse files
authored
bpo-12915: Skip test_pkgutil.test_name_resolution() non-encodable filenames (GH-18720)
When filesystem encoding cannot encode the Unicode string used for a filename continue testing with the next example.
1 parent 6df421f commit e0acec1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Lib/test/test_pkgutil.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,11 @@ def test_name_resolution(self):
246246

247247
for uw in unicode_words:
248248
d = os.path.join(self.dirname, uw)
249-
os.makedirs(d, exist_ok=True)
249+
try:
250+
os.makedirs(d, exist_ok=True)
251+
except UnicodeEncodeError:
252+
# When filesystem encoding cannot encode uw: skip this test
253+
continue
250254
# make an empty __init__.py file
251255
f = os.path.join(d, '__init__.py')
252256
with open(f, 'w') as f:

0 commit comments

Comments
 (0)