diff options
author | Sam James <sam@gentoo.org> | 2022-11-11 08:18:25 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2022-12-07 08:34:09 +0100 |
commit | 54c95b522fe6d5db80b7aa66ca2e817e96f409c6 (patch) | |
tree | fa5659597c45811e2d3f0e04dac80673840f2ccf | |
parent | gh-98636: Fix detecting gdbm_compat for _dbm module (diff) | |
download | cpython-gentoo-3.12.0a3.tar.gz cpython-gentoo-3.12.0a3.tar.bz2 cpython-gentoo-3.12.0a3.zip |
Skip tests which interact with invalid UTF-8 filesgentoo-3.12.0a3
These tests fail on filesystems which disallow
non-UTF8, like ZFS with 'utf8only' on.
Bug: https://bugs.python.org/issue37584
Bug: https://github.com/python/cpython/issues/81765
Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r-- | Lib/test/test_cmd_line_script.py | 1 | ||||
-rw-r--r-- | Lib/test/test_genericpath.py | 1 | ||||
-rw-r--r-- | Lib/test/test_httpservers.py | 1 | ||||
-rw-r--r-- | Lib/test/test_imp.py | 1 | ||||
-rw-r--r-- | Lib/test/test_import/__init__.py | 1 | ||||
-rw-r--r-- | Lib/test/test_os.py | 4 | ||||
-rw-r--r-- | Lib/test/test_sqlite3/test_dbapi.py | 2 | ||||
-rw-r--r-- | Lib/test/test_unicode_file.py | 2 | ||||
-rw-r--r-- | Lib/test/test_unicode_file_functions.py | 1 | ||||
-rw-r--r-- | Lib/test/test_zipimport.py | 1 |
10 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py index f10d72ea554..8eb3c01bfc4 100644 --- a/Lib/test/test_cmd_line_script.py +++ b/Lib/test/test_cmd_line_script.py @@ -554,6 +554,7 @@ class CmdLineTest(unittest.TestCase): self.assertTrue(text[1].startswith(' File ')) self.assertTrue(text[3].startswith('NameError')) + @unittest.skip('Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') def test_non_ascii(self): # Mac OS X denies the creation of a file with an invalid UTF-8 name. # Windows allows creating a name with an arbitrary bytes name, but diff --git a/Lib/test/test_genericpath.py b/Lib/test/test_genericpath.py index 489044f8090..e0c29149836 100644 --- a/Lib/test/test_genericpath.py +++ b/Lib/test/test_genericpath.py @@ -478,6 +478,7 @@ class CommonTest(GenericTest): for path in ('', 'fuu', 'f\xf9\xf9', '/fuu', 'U:\\'): self.assertIsInstance(abspath(path), str) + @unittest.skipIf(os_helper.TESTFN_UNENCODABLE, 'Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') def test_nonascii_abspath(self): if (os_helper.TESTFN_UNDECODABLE # macOS and Emscripten deny the creation of a directory with an diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py index ca078862cca..c7b1dd5eeb1 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -389,6 +389,7 @@ class SimpleHTTPServerTestCase(BaseTestCase): reader.close() return body + @unittest.skip('Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') @unittest.skipIf(sys.platform == 'darwin', 'undecodable name cannot always be decoded on macOS') @unittest.skipIf(sys.platform == 'win32', diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py index 80abc720c32..4b782c984c2 100644 --- a/Lib/test/test_imp.py +++ b/Lib/test/test_imp.py @@ -509,6 +509,7 @@ class PEP3147Tests(unittest.TestCase): class NullImporterTests(unittest.TestCase): + @unittest.skip('Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') @unittest.skipIf(os_helper.TESTFN_UNENCODABLE is None, "Need an undecodeable filename") def test_unencodeable(self): diff --git a/Lib/test/test_import/__init__.py b/Lib/test/test_import/__init__.py index 6c5b80bcee6..a7fa59e4731 100644 --- a/Lib/test/test_import/__init__.py +++ b/Lib/test/test_import/__init__.py @@ -1292,6 +1292,7 @@ class ImportTracebackTests(unittest.TestCase): else: importlib.SourceLoader.exec_module = old_exec_module + @unittest.skip('Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') @unittest.skipUnless(TESTFN_UNENCODABLE, 'need TESTFN_UNENCODABLE') def test_unencodable_filename(self): # Issue #11619: The Python parser and the import machinery must not diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 94db8bb7737..72139e9574e 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -2386,6 +2386,7 @@ class Pep383Tests(unittest.TestCase): def tearDown(self): shutil.rmtree(self.dir) + @unittest.skipIf(os_helper.TESTFN_UNENCODABLE, 'Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') def test_listdir(self): expected = self.unicodefn found = set(os.listdir(self.dir)) @@ -2398,11 +2399,13 @@ class Pep383Tests(unittest.TestCase): finally: os.chdir(current_directory) + @unittest.skipIf(os_helper.TESTFN_UNENCODABLE, 'Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') def test_open(self): for fn in self.unicodefn: f = open(os.path.join(self.dir, fn), 'rb') f.close() + @unittest.skipIf(os_helper.TESTFN_UNENCODABLE, 'Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') @unittest.skipUnless(hasattr(os, 'statvfs'), "need os.statvfs()") def test_statvfs(self): @@ -2412,6 +2415,7 @@ class Pep383Tests(unittest.TestCase): fullname = os.path.join(self.dir, fn) os.statvfs(fullname) + @unittest.skipIf(os_helper.TESTFN_UNENCODABLE, 'Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') def test_stat(self): for fn in self.unicodefn: os.stat(os.path.join(self.dir, fn)) diff --git a/Lib/test/test_sqlite3/test_dbapi.py b/Lib/test/test_sqlite3/test_dbapi.py index 363a308f3e5..7861fb55885 100644 --- a/Lib/test/test_sqlite3/test_dbapi.py +++ b/Lib/test/test_sqlite3/test_dbapi.py @@ -654,6 +654,7 @@ class OpenTests(unittest.TestCase): self.assertTrue(os.path.exists(path)) cx.execute(self._sql) + @unittest.skip('Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') @unittest.skipIf(sys.platform == "win32", "skipped on Windows") @unittest.skipIf(sys.platform == "darwin", "skipped on macOS") @unittest.skipIf(is_emscripten or is_wasi, "not supported on Emscripten/WASI") @@ -700,6 +701,7 @@ class OpenTests(unittest.TestCase): with self.assertRaises(sqlite.OperationalError): cx.execute(self._sql) + @unittest.skip('Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') @unittest.skipIf(sys.platform == "win32", "skipped on Windows") @unittest.skipIf(sys.platform == "darwin", "skipped on macOS") @unittest.skipIf(is_emscripten or is_wasi, "not supported on Emscripten/WASI") diff --git a/Lib/test/test_unicode_file.py b/Lib/test/test_unicode_file.py index fe25bfe9f88..cf81c329c7c 100644 --- a/Lib/test/test_unicode_file.py +++ b/Lib/test/test_unicode_file.py @@ -119,11 +119,13 @@ class TestUnicodeFiles(unittest.TestCase): # The 'test' functions are unittest entry points, and simply call our # _test functions with each of the filename combinations we wish to test + @unittest.skipIf(TESTFN_UNENCODABLE, 'Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') def test_single_files(self): self._test_single(TESTFN_UNICODE) if TESTFN_UNENCODABLE is not None: self._test_single(TESTFN_UNENCODABLE) + @unittest.skipIf(TESTFN_UNENCODABLE, 'Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') def test_directories(self): # For all 'equivalent' combinations: # Make dir with encoded, chdir with unicode, checkdir with encoded diff --git a/Lib/test/test_unicode_file_functions.py b/Lib/test/test_unicode_file_functions.py index 47619c8807b..d2fd840e91f 100644 --- a/Lib/test/test_unicode_file_functions.py +++ b/Lib/test/test_unicode_file_functions.py @@ -119,6 +119,7 @@ class UnicodeFileTests(unittest.TestCase): os.stat(name) self._apply_failure(os.listdir, name, self._listdir_failure) + @unittest.skip('Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') # Skip the test on darwin, because darwin does normalize the filename to # NFD (a variant of Unicode NFD form). Normalize the filename to NFC, NFKC, # NFKD in Python is useless, because darwin will normalize it later and so diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py index 52d43bdead6..1b8e7a20b72 100644 --- a/Lib/test/test_zipimport.py +++ b/Lib/test/test_zipimport.py @@ -720,6 +720,7 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase): files = {TESTMOD + ".py": (NOW, raise_src)} self.doTest(None, files, TESTMOD, call=self.doTraceback) + @unittest.skip('Gentoo: fails on ZFS or other strict UTF8-only filesystems (bpo 37584)') @unittest.skipIf(os_helper.TESTFN_UNENCODABLE is None, "need an unencodable filename") def testUnencodable(self): |