fix: repair Windows CI (ZipFile.extractall filter, test_smoke layout) - #392
Merged
Conversation
download_node_src() gated filter="data" on the Python version alone, but
that argument only exists on tarfile.TarFile.extractall. On Windows and
Cygwin the archive is a zip, so every install on Python 3.12+ crashed
with:
TypeError: ZipFile.extractall() got an unexpected keyword argument 'filter'
Gate it on the archive type as well. The tar path keeps filter="data".
test_smoke always sourced nenv/bin/activate with sh, but on Windows nodeenv installs into Scripts/ and writes activate.bat/Activate.ps1 - there is no posix activate script, so sh exited 1 and the test failed on every Windows runner. Run Scripts/node.exe directly there, keeping the install itself covered.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Windows jobs have been failing on every Python version. Two independent causes.
1.
ZipFile.extractall()got an unexpected keyword argumentfilterProduction bug, breaks Windows/Cygwin installs on Python 3.12+ - not just CI.
download_node_src()gated the argument on the interpreter version only:But
filter=is atarfile.TarFile.extractallparameter (PEP 706).zipfile.ZipFile.extractallhas never accepted it - its signature is still(self, path=None, members=None, pwd=None)in 3.14. On Windows and Cygwinarchiveis aZipFile, so every install raisedTypeError.Fixed by gating on the archive type as well. The tar path keeps
filter="data", so the CVE-2007-4559 protection is unchanged.Tests:
test_download_node_src_zipreproduces the crash (it fails on current master with the exact CI traceback, and passes with the fix).test_download_node_src_tar_keeps_data_filterpins the tar path so the fix cannot silently dropfilter="data". Both run on any platform.2.
test_smokeassumed a POSIX layout on WindowsTest-only bug, this is what broke Windows 3.10/3.11 (on 3.12+ it was masked by the crash above).
The test unconditionally did:
On Windows nodeenv installs into
Scripts/and writesactivate.bat/Activate.ps1- there is no POSIXactivateto source, soshexited 1.On Windows the test now runs
Scripts/node.exe --versiondirectly. This keeps the install itself covered rather than skipping the test. The POSIX branch is untouched.Verification
pytest: 81 passed locally (macOS, includingtest_smokeon the unchanged POSIX branch).flake8 --extend-ignore=E127 nodeenv.py tests setup.py: clean.The Windows side can only be confirmed by CI on this PR.