-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
argparse with subcommands difference in python 2.7 / 3.5 #72397
Comments
In python 2.7.12 I get an error if I do not pass Here is the console output: D:\util\python\test>py -3 test_argparse.py D:\util\python\test>py -2 test_argparse.py D:\util\python\test> |
The behavior change is from bpo-10424. Do you believe the new behavior is incorrect? |
I am not an expert with argparse since I just started using it But if I didn't misunderstand something it should behave like the python 2.7 version: Or:
|
Based on the usage output, it looks like the subcommand is required, but I'm not sure if there are cases where a subcommand could be optional. David, can you advise? usage: test_argparse.py [-h] command ... |
Yes there was/is a bug that made subparsers optional. http://bugs.python.org/issue9253 Now |
Given that 2.7 and 3.5 are both EOL, I think this issue is obsolete at this point. I will close this, but if someone disagrees and believes it should be left open, please let me know, and I'll be happy to reopen it. |
Definitely obsolete. The 2010 issue referenced above, now on GH, is still open. Whether it should be is a different question. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: