[issue16970] argparse: bad nargs value raises misleading message

2021-06-05 Thread Guido van Rossum
Guido van Rossum added the comment: Okay, I trust that this can be closed. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker _

[issue16970] argparse: bad nargs value raises misleading message

2021-06-05 Thread Bonifacio
Bonifacio added the comment: Every PR related to this issue (even the ones only referenced during the discussion) was already merged. Latest message is from more than one year and a half ago. The only thing left to do here would be the backport to 3.7, but according to Guido it could just b

[issue16970] argparse: bad nargs value raises misleading message

2019-08-01 Thread miss-islington
miss-islington added the comment: New changeset 1cc70322c99b80c123f9ff23a415d3da28b4ec74 by Miss Islington (bot) in branch '3.8': bpo-16970: Adding error message for invalid args (GH-14844) https://github.com/python/cpython/commit/1cc70322c99b80c123f9ff23a415d3da28b4ec74 -- ___

[issue16970] argparse: bad nargs value raises misleading message

2019-08-01 Thread Guido van Rossum
Guido van Rossum added the comment: The 3.8 backport will land automatically once the tests pass. The 3.7 backport ran into some trouble, probably a simple merge conflict. Sushma do you want to try your hands at this? It probably requires some learning about Git branches. We can also skip

[issue16970] argparse: bad nargs value raises misleading message

2019-08-01 Thread miss-islington
miss-islington added the comment: New changeset 4b3e97592376d5f8a3b75192b399a2da1be642cb by Miss Islington (bot) (tmblweed) in branch 'master': bpo-16970: Adding error message for invalid args (GH-14844) https://github.com/python/cpython/commit/4b3e97592376d5f8a3b75192b399a2da1be642cb -

[issue16970] argparse: bad nargs value raises misleading message

2019-08-01 Thread miss-islington
Change by miss-islington : -- pull_requests: +14821 pull_request: https://github.com/python/cpython/pull/15074 ___ Python tracker ___ __

[issue16970] argparse: bad nargs value raises misleading message

2019-07-18 Thread sushma
sushma added the comment: Hello! I added the patch and submitted the PR and ran the test, could you please take a look? Also, I see this 3.6 Thanks -- message_count: 8.0 -> 9.0 nosy: +syadlapalli nosy_count: 4.0 -> 5.0 pull_requests: +14635 stage: needs patch -> patch review versio

[issue16970] argparse: bad nargs value raises misleading message

2013-04-25 Thread paul j3
paul j3 added the comment: An integer nargs value is only used in one of 2 ways, range(nargs) '%s'*nargs In both a negative value acts the same as a 0. I don't think the original authors though much about 'what if the code user gives a negative value?', because nargs is counting things - the

[issue16970] argparse: bad nargs value raises misleading message

2013-04-24 Thread paul j3
paul j3 added the comment: http://bugs.python.org/issue9849 also deals with nargs values. However there the focus is on string values like '1', not whether an integer value can be 0 or <0. I submitted a patch that moves the nargs testing to a ArgumentParser._check_argument() method. It still

[issue16970] argparse: bad nargs value raises misleading message

2013-01-18 Thread Robert Leenders
Changes by Robert Leenders : Added file: http://bugs.python.org/file28767/argparse-v2.patch ___ Python tracker ___ ___ Python-bugs-list mailin

[issue16970] argparse: bad nargs value raises misleading message

2013-01-18 Thread Robert Leenders
Changes by Robert Leenders : Removed file: http://bugs.python.org/file28766/argparse-v2.patch ___ Python tracker ___ ___ Python-bugs-list mail

[issue16970] argparse: bad nargs value raises misleading message

2013-01-18 Thread Robert Leenders
Robert Leenders added the comment: Chris, you said (in the review) "Hmm, since this is for maintenance releases ... This change could cause "working" code to no longer work." I understood from our original message that you wanted it to change since it is inconsistent. I vote for changing it (s

[issue16970] argparse: bad nargs value raises misleading message

2013-01-18 Thread Chris Jerdonek
Chris Jerdonek added the comment: I added some Rietveld comments. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue16970] argparse: bad nargs value raises misleading message

2013-01-17 Thread Robert Leenders
Robert Leenders added the comment: The new issue about PARSER can be found here: http://bugs.python.org/issue16988 -- ___ Python tracker ___ _

[issue16970] argparse: bad nargs value raises misleading message

2013-01-17 Thread Chris Jerdonek
Chris Jerdonek added the comment: Thanks for the patch. I will take a look. And good observation re: PARSER. Can you open a separate documentation issue for that where it can be discussed? -- ___ Python tracker

[issue16970] argparse: bad nargs value raises misleading message

2013-01-17 Thread Robert Leenders
Robert Leenders added the comment: Attached is a patch which solves these problems and adds test cases of Chris Jerdonek. When nargs is negative the same ValueError is raised as when nargs is zero. Also when nargs is any other invalid value a ValueError("invalid value for nargs") is raised. I

[issue16970] argparse: bad nargs value raises misleading message

2013-01-15 Thread Chris Jerdonek
New submission from Chris Jerdonek: >>> parser = argparse.ArgumentParser() >>> parser.add_argument('foo', nargs='a') ... File ".../Lib/argparse.py", line 1333, in add_argument raise ValueError("length of metavar tuple does not match nargs") ValueError: length of metavar tuple does not mat