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.

classification
Title: pyvenv help shows incorrect usage
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: python-dev, raulcd, vinay.sajip, vstinner
Priority: normal Keywords: patch

Created on 2015-01-31 09:50 by raulcd, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
23357.patch raulcd, 2015-01-31 09:53 review
23357.2.patch raulcd, 2015-01-31 21:18 review
23357.3.patch raulcd, 2015-02-02 20:55 review
Messages (12)
msg235094 - (view) Author: Raúl Cumplido (raulcd) * Date: 2015-01-31 09:50
Currently when you execute pyvenv the help message is wrong:

host@~  $ pyvenv
usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear]
            [--upgrade] [--without-pip]
            ENV_DIR [ENV_DIR ...]
venv: error: the following arguments are required: ENV_DIR

Based on the docs on https://docs.python.org/3/library/venv.html it should be:

host@~  $ pyvenv
usage: pyvenv [-h] [--system-site-packages] [--symlinks | --copies] [--clear]
              [--upgrade] [--without-pip]
              ENV_DIR [ENV_DIR ...]
pyvenv: error: the following arguments are required: ENV_DIR

Basically instead of saying usage venv it should say usage pyvenv but if you execute the module it should be venv:

host@~  $ python3.5 -m venv
usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear]
            [--upgrade] [--without-pip]
            ENV_DIR [ENV_DIR ...]
venv: error: the following arguments are required: ENV_DIR
msg235096 - (view) Author: Raúl Cumplido (raulcd) * Date: 2015-01-31 09:53
Patch that solves the issue.

I am on Misc/ACKS on branch 3.4 but not on default branch. I would appreciate if that gets merged to be added :)
msg235120 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-01-31 16:53
Could you please write an unit test for non-regression?
msg235130 - (view) Author: Raúl Cumplido (raulcd) * Date: 2015-01-31 21:18
Added tests (hope is what you expect) and changed some bits on the test file to be pep8 comliant.
msg235232 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2015-02-02 08:03
Thanks for the suggestion, but

(a) I don't think it's worth making this change.
(b) Your change still won't do the right thing in all cases.
(c) Your approach (of passing a parameter just for this) doesn't feel right.

For example, what if pyvenv is invoked using a symlink such as pyvenv-3.4? Your code would say "pyvenv", which seems "just as wrong" as saying "venv".

I don't believe the current state of affairs is really confusing (it hasn't been brought up before) - and even if it is, the right fix seems to be to mention in the documentation that the usage statement may vary slightly depending on exactly how the venv functionality is invoked.
msg235234 - (view) Author: Raúl Cumplido (raulcd) * Date: 2015-02-02 08:29
So, do you think that maybe adding something to the documentation. Or we just leave it as it is?
msg235236 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2015-02-02 09:54
I will add to the documentation, and leave this issue open till I've done that.
msg235237 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-02-02 10:17
> Added tests (hope is what you expect) and changed some bits on the test file to be pep8 comliant.

Nooo, please don't change two things in same patch: open a new issue for your PEP 8 changes.
msg235239 - (view) Author: Raúl Cumplido (raulcd) * Date: 2015-02-02 10:41
thanks for the comments.
@haypo I'll add a new one for the pep8 fixes, sorry.
@vinay.sajip I would like to help and try to do the change myself, if this is ok with you
msg235273 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2015-02-02 17:02
> I would like to help and try to do the change myself

You mean the documentation change? Go right ahead! Just make the change to the 3.4 branch, and I will ensure it's merged into the default branch (3.5). Have you completed a contributor form, as a matter of interest?
msg235286 - (view) Author: Raúl Cumplido (raulcd) * Date: 2015-02-02 20:55
From your question, yes I have completed the form.
I've added a new patch just with the documentation change and changing the output from the help command as it was wrong. If it doesn't make sense do let me know. I've done it from 3.4
msg235519 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-02-07 10:57
New changeset 751910294200 by Vinay Sajip in branch 'default':
Closes #23357: Updated documentation on creating venvs.
https://hg.python.org/cpython/rev/751910294200
History
Date User Action Args
2022-04-11 14:58:12adminsetgithub: 67546
2015-02-07 10:57:48python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg235519

resolution: fixed
stage: patch review -> resolved
2015-02-02 20:55:22raulcdsetfiles: + 23357.3.patch

messages: + msg235286
2015-02-02 17:02:23vinay.sajipsetmessages: + msg235273
2015-02-02 10:41:06raulcdsetmessages: + msg235239
2015-02-02 10:17:12vstinnersetmessages: + msg235237
2015-02-02 09:54:34vinay.sajipsetmessages: + msg235236
2015-02-02 08:29:48raulcdsetmessages: + msg235234
2015-02-02 08:03:29vinay.sajipsetmessages: + msg235232
2015-02-02 03:07:25berker.peksagsetnosy: + vinay.sajip
stage: patch review

versions: - Python 3.6
2015-01-31 21:18:56raulcdsetfiles: + 23357.2.patch

messages: + msg235130
2015-01-31 16:53:32vstinnersetnosy: + vstinner
messages: + msg235120
2015-01-31 09:53:47raulcdsetfiles: + 23357.patch
keywords: + patch
messages: + msg235096
2015-01-31 09:50:15raulcdcreate