Repository navigation
🐛 fix(create): reject oversized CPython config - #3613
Merged
gaborbernat merged 3 commits intoNov 20, 2026
Merged
Conversation
CPython 3.9 and 3.10 can start with a 33 KiB pyvenv.cfg. Keep those versions working while rejecting files above the limit on newer CPython.
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.
The configuration writer accepted a
pyvenv.cfglarge enough that CPython 3.11+ could not read it on startup. It now checks the encoded size before replacing the file. Fixes #3601.CPython size limit
The updated write path rejects a CPython 3.11+ configuration of 32 KiB or more with
ValueError. The check uses encoded bytes because non-ASCII prompt text can use more than one byte per character. CPython 3.9 and 3.10 can start with a 33 KiB config, so they retain the previous behavior.Creation fails before replacing an existing config if the limit is reached. Other Python implementations keep their existing write behavior.
Report
ANT-2026-QQPFLYHX.