Author Michael.Felt
Recipients Michael.Felt, barry, benthayer, jaraco, miss-islington
Date 2020-06-06.15:12:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1591456369.7.0.130958990417.issue39791@roundup.psfhosted.org>
In-reply-to
Content
The 'fancy' file name breaks on latin-1 character set.

aixtools@gcc119:[/home/aixtools/python/py39-3.9] a4fa9a95153a3800dea60b3029b2dcaf8a4f6acb Lib/test/test_importlib/test_main.py                   <
diff --git a/Lib/test/test_importlib/test_main.py b/Lib/test/test_importlib/test_main.py
index 42a7999..7b18c3d 100644
--- a/Lib/test/test_importlib/test_main.py
+++ b/Lib/test/test_importlib/test_main.py
@@ -246,3 +246,19 @@ class TestEntryPoints(unittest.TestCase):
         """
         with self.assertRaises(Exception):
             json.dumps(self.ep)
+
+    def test_module(self):
+        assert self.ep.module == 'value'
+
+    def test_attr(self):
+        assert self.ep.attr is None
+
+
+class FileSystem(fixtures.OnSysPath, fixtures.SiteDir, unittest.TestCase):
+    def test_unicode_dir_on_sys_path(self):
+        """
+        Ensure a Unicode subdirectory of a directory on sys.path
+        does not crash.
+        """
+        fixtures.build_files({'☃': {}}, prefix=self.site_dir)
+        list(distributions())

AIX bots fail with:

Captured traceback
==================

Traceback (most recent call last):
  File "/home/shager/cpython-buildarea/3.9.edelsohn-aix-ppc64/build/Lib/test/test_importlib/test_main.py", line 263, in test_unicode_dir_on_sys_path
    fixtures.build_files({'\u2603': {}}, prefix=self.site_dir)
  File "/home/shager/cpython-buildarea/3.9.edelsohn-aix-ppc64/build/Lib/test/test_importlib/fixtures.py", line 202, in build_files
    full_name.mkdir()
  File "/home/shager/cpython-buildarea/3.9.edelsohn-aix-ppc64/build/Lib/pathlib.py", line 1309, in mkdir
    self._accessor.mkdir(self, mode)
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2603' in position 17: ordinal not in range(256)



Test report
===========

Failed tests:

- test_importlib
History
Date User Action Args
2020-06-06 15:12:49Michael.Feltsetrecipients: + Michael.Felt, barry, jaraco, miss-islington, benthayer
2020-06-06 15:12:49Michael.Feltsetmessageid: <1591456369.7.0.130958990417.issue39791@roundup.psfhosted.org>
2020-06-06 15:12:49Michael.Feltlinkissue39791 messages
2020-06-06 15:12:49Michael.Feltcreate