Origin: Surfaced when the Windows CI matrix entries (added in PR #639 closing #637) ran for the first time. 6 tests in tests/test_cli.py::TestStdinInput::* fail on Windows with Error: file not found: /dev/stdin.
The pattern
Vera's CLI supports vera <subcommand> /dev/stdin as a way to read source from stdin (an alternative to the - convention used by some other CLIs). /dev/stdin is a Unix-specific path — Windows doesn't have it.
Failing tests:
test_check_reads_source_once
test_run_dev_stdin_subprocess
test_verify_dev_stdin_subprocess
test_compile_dev_stdin_wat
test_compile_dev_stdin_default_output
test_check_dev_stdin_module_resolution
All hit the same shape:
CompletedProcess(args=['python.exe', '-m', 'vera.cli', 'check', '/dev/stdin'],
returncode=1, stderr='Error: file not found: /dev/stdin\n')
Recommended fix
Two parts:
-
CLI: add Windows-compatible stdin handling. Either (a) special-case - as a stdin sentinel (Unix convention), (b) detect /dev/stdin on Windows and silently route to sys.stdin, or (c) add a dedicated --stdin flag. Option (a) is most idiomatic across CLI tools; option (b) is most backward-compatible (existing /dev/stdin users on Unix keep working, Windows just learns to handle it).
-
Tests: parametrize over the stdin sentinel. tests/test_cli.py::TestStdinInput should test both /dev/stdin (Unix) and whichever sentinel is chosen for Windows (- or whatever). On Windows, the /dev/stdin parameterisation should pytest.skip("Unix-only").
Out of scope
- Renaming or deprecating
/dev/stdin support on Unix. Keep it for backward compatibility.
- Other Unix-only paths in the CLI (e.g.
/dev/null). If they show up as Windows test failures, file separately.
Acceptance criteria
- All 6 tests in
tests/test_cli.py::TestStdinInput pass on windows-latest, 3.{11,12,13} after the fix.
- Existing
/dev/stdin invocations on Unix continue to work.
Pairs with
Origin: Surfaced when the Windows CI matrix entries (added in PR #639 closing #637) ran for the first time. 6 tests in
tests/test_cli.py::TestStdinInput::*fail on Windows withError: file not found: /dev/stdin.The pattern
Vera's CLI supports
vera <subcommand> /dev/stdinas a way to read source from stdin (an alternative to the-convention used by some other CLIs)./dev/stdinis a Unix-specific path — Windows doesn't have it.Failing tests:
test_check_reads_source_oncetest_run_dev_stdin_subprocesstest_verify_dev_stdin_subprocesstest_compile_dev_stdin_wattest_compile_dev_stdin_default_outputtest_check_dev_stdin_module_resolutionAll hit the same shape:
Recommended fix
Two parts:
CLI: add Windows-compatible stdin handling. Either (a) special-case
-as a stdin sentinel (Unix convention), (b) detect/dev/stdinon Windows and silently route tosys.stdin, or (c) add a dedicated--stdinflag. Option (a) is most idiomatic across CLI tools; option (b) is most backward-compatible (existing/dev/stdinusers on Unix keep working, Windows just learns to handle it).Tests: parametrize over the stdin sentinel.
tests/test_cli.py::TestStdinInputshould test both/dev/stdin(Unix) and whichever sentinel is chosen for Windows (-or whatever). On Windows, the/dev/stdinparameterisation shouldpytest.skip("Unix-only").Out of scope
/dev/stdinsupport on Unix. Keep it for backward compatibility./dev/null). If they show up as Windows test failures, file separately.Acceptance criteria
tests/test_cli.py::TestStdinInputpass onwindows-latest, 3.{11,12,13}after the fix./dev/stdininvocations on Unix continue to work.Pairs with
\Uescape investigation.