[New-bugs-announce] [issue41011] [venv] record which executable and command were used to create a virtual environment

Brett Cannon report at bugs.python.org
Wed Jun 17 17:25:38 EDT 2020


New submission from Brett Cannon <brett at python.org>:

When a virtual environment is created, the resulting pyvenv.cfg specifies the directory which contained the Python executable and the version of Python (see https://github.com/python/cpython/blob/master/Lib/venv/__init__.py#L147). Unfortunately that may not be enough to work backwards to which binary was used to create the virtual environment.

My idea is to add an `executable` and `command` key to pyvenv.cfg which record the Python executable name and the command used to construct the virtual environment, respectively. The former would disambiguate which exact Python interpreter was used, and the `command` key could be used by e.g. virtualenv to record what was used to construct the virtual environment. That potentially could be used to make recreating a broken virtual environment easier.

----------
components: Library (Lib)
messages: 371775
nosy: brett.cannon, vinay.sajip
priority: normal
severity: normal
status: open
title: [venv] record which executable and command were used to create a virtual environment
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41011>
_______________________________________


More information about the New-bugs-announce mailing list