This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author brett.cannon
Recipients brett.cannon
Date 2015-09-17.18:35:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1442514921.37.0.255858283829.issue25154@psf.upfronthosting.co.za>
In-reply-to
Content
I propose that the pyvenv script be deprecated in Python 3.5 and removed in Python 3.8. The reason for this proposal is because it is non-obvious what version of Python a pyvenv command is tied to (heck, it isn't necessarily obvious that it's Python 3). There would be no loss in functionality since the exact same functionality is available through `python3 -m venv`. This is a backwards-compatibility change, hence the deprecation, but changing various shell scripts and such should be trivial thanks to the -m flag. This would also help promote the use of -m, especially for any projects that rely on being tied to a specific installed interpreter.

As pointed out in issue #25152, virtualenv provides a -p flag to specify what version of Python should be used to create a virtual environment: https://virtualenv.pypa.io/en/latest/reference.html#virtualenv-command. The pyvenv script and venv package provide no such mechanism since it is included in the stdlib, which makes sense since improvements will be tied to the stdlib of the Python interpreter being used while virtualenv is a standalone project/app.

Some may argue that worrying about this is unnecessary, but we are already ending up with OSs that come with multiple versions of Python pre-installed, let alone when people install their own versions of Python on top of the system installation. For instance, OS X Yosemite comes with Python 2.6 and 2.7, and then if you install the latest version of Python independently you end up with 3 installations. If they all happened to have a pyvenv script you wouldn't easily know which Python interpreter the pyvenv command was going to use for the virtual environment.

Since the pyvenv script is just a script, the deprecation will be in the form of a message printed to sys.stderr in the Tools/scripts/pyvenv file mentioning that the deprecation and that people should switch to `python3 -m venv` instead. The long deprecation cycle is for those who have pyvenv provided by their OS and only upgrade Python every few years, and thus run the risk of missing the deprecation warning. As for the deprecation in Python 3.5.1, that's to get the warning out immediately and to minimize people missing the deprecation prior to the removal.
History
Date User Action Args
2015-09-17 18:35:21brett.cannonsetrecipients: + brett.cannon
2015-09-17 18:35:21brett.cannonsetmessageid: <1442514921.37.0.255858283829.issue25154@psf.upfronthosting.co.za>
2015-09-17 18:35:21brett.cannonlinkissue25154 messages
2015-09-17 18:35:20brett.cannoncreate