From: Michael Felt Date: Tue, 3 Mar 2020 10:11:11 +0000 (+0100) Subject: bpo-12915: Skip test_pkgutil.test_name_resolution() non-encodable filenames (GH-18720) X-Git-Tag: v3.9.0a5~189 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e0acec15412203359d59db33e447698ee51e07fc;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/test/test_pkgutil.py b/Lib/test/test_pkgutil.py index 53456c2f7659..b162f9949ff6 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: