Repository navigation
π fix(python): bound base_python_file reads - #4325
Merged
gaborbernat merged 2 commits intoOct 30, 2026
Merged
gaborbernat merged 2 commits into
gaborbernat merged 2 commits into
Conversation
Reject non-regular files, undecodable content and over-long version lines with a handled error instead of loading the whole file and stalling Python discovery.
The bounded reader rejected long blank lines and indented comments that the previous parser ignored. Scan those lines in bounded chunks before selecting the first version.
rahuldevikar
force-pushed
the
radevika-microsoft-fix-invalid-base-python-file
branch
from
October 30, 2026 17:44
8b9026f to
33192d0
Compare
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.
An oversized first line in
base_python_filecould consume hundreds of MiB and echo the line in tox output; a directory or undecodable file could raise an unhandled error (#4243). tox now bounds version-line reads and reports a handled input error naming the file.The version-file reader checks file type and decoding at the read boundary, skips long comments and blank lines in bounded chunks, and passes a version line of at most 1024 characters to Python discovery. Fixes #4243.