summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMichael Felt <aixtools@users.noreply.github.com>2020-03-03 10:11:11 (GMT)
committerGitHub <noreply@github.com>2020-03-03 10:11:11 (GMT)
commite0acec15412203359d59db33e447698ee51e07fc (patch)
treed9f7c88378d3bef53dd7f5db3bff0a35d0618c91 /Lib
parent6df421fe87a9418d6c59f89dbc5d5573b6826855 (diff)
downloadcpython-e0acec15412203359d59db33e447698ee51e07fc.zip
cpython-e0acec15412203359d59db33e447698ee51e07fc.tar.gz
cpython-e0acec15412203359d59db33e447698ee51e07fc.tar.bz2
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.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_pkgutil.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_pkgutil.py b/Lib/test/test_pkgutil.py
index 53456c2..b162f99 100644
--- a/Lib/test/test_pkgutil.py
+++ b/Lib/test/test_pkgutil.py
@@ -246,7 +246,11 @@ class PkgutilTests(unittest.TestCase):
for uw in unicode_words:
d = os.path.join(self.dirname, uw)
- os.makedirs(d, exist_ok=True)
+ try:
+ os.makedirs(d, exist_ok=True)
+ except UnicodeEncodeError:
+ # When filesystem encoding cannot encode uw: skip this test
+ continue
# make an empty __init__.py file
f = os.path.join(d, '__init__.py')
with open(f, 'w') as f: