Skip to content

test(aperture): fix Windows-illegal quote filename in #2555 test (#2961) - #2962

Merged
squid-protocol merged 1 commit into
mainfrom
fix/2961-windows-quotepath-test
Sep 11, 2026
Merged

test(aperture): fix Windows-illegal quote filename in #2555 test (#2961)#2962
squid-protocol merged 1 commit into
mainfrom
fix/2961-windows-quotepath-test

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Summary

test_malformed_extension_not_leaked_into_reason (added in #2946 / #2555) failed on the Windows legs of the Full Suite Gate (Python 3.9 and 3.12) — Linux/macOS passed. It created a real file named naive.txt"; " is a legal filename char on POSIX but illegal on Windows, so write_text raised OSError: [Errno 22] before any assertion ran.

AperturePolicy.evaluate_path_integrity is by design "Gate 1: Zero-I/O Path Evaluation" — the no_extension sanitization (aperture.py:235-241) is pure string analysis of the path, and size_bytes already falls back to 0 when the file is absent (the .exists()/.stat() pair is wrapped in try/except OSError). So the test never needed the file on disk.

Fix: drop bad.write_text(...) and evaluate the constructed Path directly. Keeps the assertions meaningful and restores Windows coverage (the Path string is fine there; only filesystem ops fail).

Verification

  • pytest tests/core_engine/test_lang_classification_2555.py9 passed (existence was not load-bearing for reaching the no_extension branch).

Separate from the #2933 slicer PR, per the one-layer-per-PR rule.

Closes #2961

🤖 Generated with Claude Code

test_malformed_extension_not_leaked_into_reason created a real file named
`naive.txt"`. `"` is a legal filename char on POSIX (where a git quotepath
artifact can actually produce this name) but illegal on Windows, so
write_text raised `OSError: [Errno 22]` on the Windows Full Suite Gate legs
(3.9 and 3.12) before any assertion ran.

evaluate_path_integrity is "Gate 1: Zero-I/O Path Evaluation": the malformed-
extension sanitization is pure string analysis of the path and size_bytes
falls back to 0 when the file is absent, so evaluating the constructed Path
alone keeps the test meaningful -- and now cross-platform -- without touching
the filesystem.

Closes #2961

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014rUcYDAzYYCgrLdHyKBT9G
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol marked this pull request as ready for review September 11, 2026 15:21
@squid-protocol
squid-protocol merged commit 2d42461 into main Sep 11, 2026
28 checks passed
@squid-protocol
squid-protocol deleted the fix/2961-windows-quotepath-test branch September 11, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows CI: test_malformed_extension_not_leaked_into_reason writes a file with a quote in its name (illegal on Windows)

1 participant