[issue16142] ArgumentParser inconsistent with parse_known_args

2019-11-12 Thread Lewis Gaul
Change by Lewis Gaul : -- nosy: +aeros ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16142] ArgumentParser inconsistent with parse_known_args

2019-10-27 Thread Benjamin Edwards
Benjamin Edwards added the comment: Hey this has been open for quite a while, is there anything that needs finishing off? -- nosy: +benedwards14 ___ Python tracker ___

[issue16142] ArgumentParser inconsistent with parse_known_args

2016-06-30 Thread Omar Sandoval
Changes by Omar Sandoval : -- nosy: +Omar Sandoval ___ Python tracker ___ ___

[issue16142] ArgumentParser inconsistent with parse_known_args

2016-03-18 Thread Dario Giovannetti
Changes by Dario Giovannetti : -- nosy: +kynikos ___ Python tracker ___ ___

[issue16142] ArgumentParser inconsistent with parse_known_args

2013-04-29 Thread paul j3
paul j3 added the comment: Correction: The patch I gave in the last message produces: parser.parse_known_args(['-ku']) (Namespace(known=False), ['u']) It doesn't take action on the '-k', and puts 'u' in extras, not '-u'. This new patch gets it right:

[issue16142] ArgumentParser inconsistent with parse_known_args

2013-04-17 Thread paul j3
paul j3 added the comment: parser = argparse.ArgumentParser() parser.add_argument('-k','--known',action='store_true') print(parser.parse_known_args(['-k','-u'])) print(parser.parse_known_args(['-ku'])) print(parser.parse_known_args(['-uk'])) I think you want these 3 cases to

[issue16142] ArgumentParser inconsistent with parse_known_args

2013-02-02 Thread Radu Ciorba
Radu Ciorba added the comment: - if the unknown option is given first then both options are treated as unknown and returned in the list of remaining arguments. I don't think this case is correct behaviour. There is no way to determine if u accepts arguments or not. If nargs for -u is ? or

[issue16142] ArgumentParser inconsistent with parse_known_args

2013-02-02 Thread Andrei Vereha
Changes by Andrei Vereha aver...@gmail.com: -- nosy: +Andrei.Vereha ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16142 ___ ___ Python-bugs-list

[issue16142] ArgumentParser inconsistent with parse_known_args

2012-10-23 Thread Sam Breese
Sam Breese added the comment: Make that a few days. I fixed the case where the known arg is first, but not the other one. Will get to it soon, hopefully. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16142

[issue16142] ArgumentParser inconsistent with parse_known_args

2012-10-21 Thread Sam Breese
Sam Breese added the comment: Writing a patch now. Should be ready in a few hours. -- nosy: +Sam.Breese ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16142 ___

[issue16142] ArgumentParser inconsistent with parse_known_args

2012-10-05 Thread Idan Kamara
New submission from Idan Kamara: When known and unknown options are given together in the same option string (e.g. -xy) then ArgumentParser behaves in a strange way: - if the known option is given first (so -k is known and the parser is fed with ['-ku']) then the parsing aborts with error:

[issue16142] ArgumentParser inconsistent with parse_known_args

2012-10-05 Thread R. David Murray
R. David Murray added the comment: Looks like parse_known_args needs to be taught to not treat unknown text following an option as an argument if the option does not take an argument. That would be in keeping with its mission, I think :) There will still probably be ambiguous cases that will

[issue16142] ArgumentParser inconsistent with parse_known_args

2012-10-05 Thread Idan Kamara
Idan Kamara added the comment: Yes that'd fix the known option before unknown but not the other way around. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16142 ___

[issue16142] ArgumentParser inconsistent with parse_known_args

2012-10-05 Thread R. David Murray
R. David Murray added the comment: Right. I didn't read what you wrote carefully enough. Clearly parse_known_args is buggy here. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16142 ___