Skip to content

fix: repair Windows CI (ZipFile.extractall filter, test_smoke layout) - #392

Merged
ekalinin merged 2 commits into
masterfrom
fix/windows-ci
Aug 13, 2026
Merged

fix: repair Windows CI (ZipFile.extractall filter, test_smoke layout)#392
ekalinin merged 2 commits into
masterfrom
fix/windows-ci

Conversation

@ekalinin

Copy link
Copy Markdown
Owner

Windows jobs have been failing on every Python version. Two independent causes.

1. ZipFile.extractall() got an unexpected keyword argument filter

Production bug, breaks Windows/Cygwin installs on Python 3.12+ - not just CI.

download_node_src() gated the argument on the interpreter version only:

if sys.version_info >= (3, 12):
    archive.extractall(src_dir, extract_list, filter="data")

But filter= is a tarfile.TarFile.extractall parameter (PEP 706). zipfile.ZipFile.extractall has never accepted it - its signature is still (self, path=None, members=None, pwd=None) in 3.14. On Windows and Cygwin archive is a ZipFile, so every install raised TypeError.

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_zip reproduces the crash (it fails on current master with the exact CI traceback, and passes with the fix). test_download_node_src_tar_keeps_data_filter pins the tar path so the fix cannot silently drop filter="data". Both run on any platform.

2. test_smoke assumed a POSIX layout on Windows

Test-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:

activate = _quote(os.path.join(nenv_path, 'bin', 'activate'))
subprocess.check_call(['sh', '-c', '. {} && node --version'.format(activate)])

On Windows nodeenv installs into Scripts/ and writes activate.bat / Activate.ps1 - there is no POSIX activate to source, so sh exited 1.

On Windows the test now runs Scripts/node.exe --version directly. This keeps the install itself covered rather than skipping the test. The POSIX branch is untouched.

Verification

pytest: 81 passed locally (macOS, including test_smoke on 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.

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.
@ekalinin ekalinin added bug tests and removed bug labels Aug 13, 2026
@ekalinin
ekalinin merged commit eb26d7f into master Aug 13, 2026
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant