Fix Windows source header checks - #519
Open
ryanduguid wants to merge 2 commits into
Open
ryanduguid wants to merge 2 commits into
ryanduguid wants to merge 2 commits into
Conversation
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.
Summary
Make the source-header checker work on native Windows by reading UTF-8 explicitly and accepting slash-based relative headings. Existing native-path and basename headings remain valid; both validation regexes and the read limit are unchanged. The regression tests skip site startup hooks in their standard-library-only subprocess so pytest-cov cannot start unwanted child coverage from the temporary working directory.
Evidence
UnicodeDecodeErrorunder cp1252. With UTF-8 enabled, the complete checker instead reports 15 incorrect-identification errors in updater scripts.-S.stdnumbranch-coverage gate remains 100%; it does not measure the subprocess checker.-Sto the checker subprocess fixes the full suite without changing coverage configuration or its threshold.d2a8d5206731c9ba72b4d6ef2c9e5858d45f3065, including Linux CPython 3.8 through 3.14 and PyPy 3.9.Merge danger
Door: two-way. Blast radius: contributor checks.
The file scan and licence policy stay the same. UTF-8 decoding remains strict, and native diagnostic paths are preserved. No dependency or library validator changes.
Unverified
macOS, PyPy and the remaining Linux interpreter matrix were not tested locally.
The default Windows flake8 run still encounters the pre-existing cp1252 decoding failure; this change repairs the separate header script. The new tests invoke the checker directly and do not create
scripts/__pycache__, which the existing glob would try to read as a file.