diff options
author | Petr Viktorin <encukou@gmail.com> | 2019-09-26 13:16:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-26 13:16:32 (GMT) |
commit | 3d984a1fd0c05903268542a216fc496074b2e6da (patch) | |
tree | 131ce4ea4cefad7fb47148cdec46bb2b7733c147 | |
parent | 4f2eac04e4fee4d7d188ad2eeb0e610e3d7254bb (diff) | |
download | cpython-3d984a1fd0c05903268542a216fc496074b2e6da.zip cpython-3d984a1fd0c05903268542a216fc496074b2e6da.tar.gz cpython-3d984a1fd0c05903268542a216fc496074b2e6da.tar.bz2 |
compileall tests: Use shorter name for long_path test (GH-16419)
Apparently, the path needs to be limited to 260 characters on
(some versions of) Windows.
-rw-r--r-- | Lib/test/test_compileall.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py index 205457f..3bb03b3 100644 --- a/Lib/test/test_compileall.py +++ b/Lib/test/test_compileall.py @@ -53,7 +53,7 @@ class CompileallTestsBase: # It will be 100 directories deep, or shorter if the OS limits it. for i in range(10): longer_path = os.path.join( - long_path, *(f"long_directory_{i}_{j}" for j in range(10)) + long_path, *(f"dir_{i}_{j}" for j in range(10)) ) # Check if we can open __pycache__/*.pyc. @@ -87,8 +87,12 @@ class CompileallTestsBase: long_source = longer_source long_cache = longer_cache + # On Windows, MAX_PATH is 260 characters, our path with the 20 + # directories is 160 characters long, leaving something for the + # root (self.directory) as well. + # Tests assume long_path contains at least 10 directories. if i < 2: - raise ValueError('Path limit is too short') + raise ValueError(f'"Long path" is too short: {long_path}') self.source_path_long = long_source self.bc_path_long = long_cache |