[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2019-08-24 Thread paul j3
paul j3 added the comment: https://bugs.python.org/issue26510 https://bugs.python.org/issue33109 There was some flip/flop over whether required should be true by default or not - the current behavior is False, (the 3.3.0) The lasting change since this issue in 2012 is that `add_subparsers`

[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2019-08-24 Thread Ashwin Ramaswami
Ashwin Ramaswami added the comment: What's the status of this? Was paul.j3's patch ever reviewed? -- nosy: +epicfaace ___ Python tracker ___

[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2013-05-01 Thread Michele OrrĂ¹
Changes by Michele OrrĂ¹ maker...@gmail.com: -- nosy: +maker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16308 ___ ___ Python-bugs-list mailing

[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2013-04-18 Thread R. David Murray
R. David Murray added the comment: Yes, just with limited amounts of attention to spare :( This is a rather difficult situation, since it appears we inadvertently changed a behavior. Fortunately it was in a feature release. Unfortunately a new parameter to make a subparser required again

[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2013-04-18 Thread paul j3
paul j3 added the comment: I submitted a patch to http://bugs.python.org/issue9253 The reason why subparser became optional in the latest release is that a old test for missing positionals was phased out, and new one added. Subparsers have always had a default 'required=False', but the old

[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2012-12-10 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16308 ___

[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2012-12-09 Thread telmich
telmich added the comment: Anyone alive at bugs.python.org? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16308 ___ ___ Python-bugs-list

[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2012-11-08 Thread telmich
telmich added the comment: Any news on this one? If the proposed changes are ok for you, I'd implement two patches: - fix set_defaults() to not propagate func= to child parsers = makes it usable - add required= argument to add_subparsers, defaulting to False --

[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2012-10-28 Thread Andrew Svetlov
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16308 ___ ___

[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2012-10-24 Thread telmich
New submission from telmich: Using argparse with subparsers, the default behaviour if no subparser was selected, was to print help: cdist% git describe 2.0.14-59-g5315c41 cdist% ./bin/cdist usage: cdist [-h] [-d] [-v] [-V] {banner,config} ... cdist: error: too few arguments cdist% python3 -V

[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2012-10-24 Thread R. David Murray
R. David Murray added the comment: There was bug fixing/enhancement activity around subparsers, one of them probably had an unexpected side effect for which there are currently no tests. If you can figure out which change set introduced the change, that might speed up resolution of the

[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2012-10-24 Thread telmich
telmich added the comment: Having a closer look at the changes using hg diff -r v3.2:v3.3.0 Lib/argparse.py, it seems the following removal could be related to the different behaviour: -# if we didn't use all the Positional objects, there were too few -# arg strings supplied.

[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2012-10-24 Thread R. David Murray
R. David Murray added the comment: Thanks. I've put this on my todo list to look at this weekend during the bug day. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16308 ___

[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2012-10-24 Thread telmich
telmich added the comment: Thanks a lot - let me know when I can help more. After re-reading the documentation, I think the behaviour for subparsers is not specified: It is not specified, whether a subparser is required to be present or not. Attached stripped down version of the cdist code

[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2012-10-24 Thread telmich
telmich added the comment: I've copy pasted the example from the documentation and added the following lines to it (attached full file) args = parser.parse_args('') args.func(args) Following the style / way show in the documentation, I'd expect this block to work (3.2.2 behaviour). I do

[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2012-10-24 Thread telmich
telmich added the comment: Assuming 3.3.0 behaviour is correct (as in no subparser specified, args.func not setup), I'd expect to have setup a function on the main parser. Trying this, it prevents the subparsers function from being completly: [16:03] brief:~% python3 subparse3.py

[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2012-10-24 Thread telmich
telmich added the comment: Proposal / resume from the previous tests: - add a parameter to add_subparsers(): required If required=True, one of the subcommand names need to be present. If required=False (default), allow parse_args() to return successfully, if no subcommand is given. -

[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2012-10-24 Thread R. David Murray
R. David Murray added the comment: How does all of this relate to issue 9253? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16308 ___ ___

[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2012-10-24 Thread telmich
telmich added the comment: Interesting! The issue 9523 has now somehow become obsolete, as in 3.3.0 subcommands are de-facto optional, which is the problem I am facing. Regarding my last comment, here are the relations: - add a parameter to add_subparsers(): required This is a similar

[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2012-10-24 Thread telmich
telmich added the comment: s/9523/9253/g in my previous post -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16308 ___ ___ Python-bugs-list