Repository navigation
馃悰 fix(create): skip blank and comment lines in pyvenv.cfg - #3232
Merged
Merged
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
gaborbernat
enabled auto-merge (squash)
September 15, 2026 22:06
gaborbernat
disabled auto-merge
September 15, 2026 22:06
gaborbernat
force-pushed
the
fix-pyvenv-cfg-skip-blank
branch
from
September 15, 2026 22:08
78dd1c6 to
701a48c
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.
PyEnvCfg._read_valuescalledline.index("=")on each line ofpyvenv.cfg, so a blank line, a#comment or a linewithout
=raisedValueErrorwhen virtualenv read the file of an existing environment.The parser now skips those lines.
test_pyenv_cfg_from_folder_skips_non_entriesintests/unit/create/test_creator.pycovers each case and fails on
main.