Skip to content

Be more purposeful in the Python version in pyvenv.cfg #102522

Open
@brettcannon

Description

@brettcannon

In pyvenv.cfg, there's a version field that records ".".join(sys.version_info[:3]). The interesting thing about this is it isn't loose enough to reflect the version accurately if the Python interpreter is updated in-place (e.g. going from Python 3.11.1 to 3.11.2). But it's also not accurate enough to reflect the exact Python version (e.g. Python 3.12.0a6 is recorded as 3.12.0).

Because of this I'm not sure what the number is meant to represent. If it's meant to record what the version was when the virtual environment was created then we should either change the field to record the release level or add another field that records that. But if it's just meant to record what the version might be, then it's a bit too specific.

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtopic-venvRelated to the venv moduletype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions