馃悰 fix(create): skip blank and comment lines in pyvenv.cfg - #3232
Open
r3wretrhy wants to merge 1 commit into
Open
馃悰 fix(create): skip blank and comment lines in pyvenv.cfg#3232r3wretrhy wants to merge 1 commit into
r3wretrhy wants to merge 1 commit into
Conversation
Reading an existing pyvenv.cfg called line.index("=") on every line, so a
blank line, a comment or any line without a separator raised ValueError
while refreshing an environment. Skip those lines instead, matching how
CPython parses the same file.
Co-authored-by: Bernat Gabor <gaborjbernat@gmail.com>
Claude-Session: https://claude.ai/code/session_011VmD9PD4Vf9AFkFbwqvskx
gaborbernat
force-pushed
the
fix-pyvenv-cfg-skip-blank
branch
from
September 9, 2026 05:16
8a5b8ec to
01fbfda
Compare
gaborbernat
approved these changes
Sep 9, 2026
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.
PyEnvCfg._read_valuesusedline.index("=")on every line ofpyvenv.cfg. A blank line, a#comment, or a line without=therefore raisedValueErrorwhile refreshing an existing environment.Skip those lines and keep the
key = valueentries. Quoted values are still unquoted the same way.The added test fails on the unpatched tree and passes with the change.