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.

Author vegarsti
Recipients vegarsti
Date 2020-08-20.12:00:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1597924844.66.0.620020425851.issue41600@roundup.psfhosted.org>
In-reply-to
Content
In fact, what happens in the latter case (i.e. `"--a 1 --b 2"`), inside the call to `_parse_optional`, is that it fails to get the optional tuple. And so it continues to this line in argparse.py: 
https://github.com/python/cpython/blob/2ce39631f679e14132a54dc90ce764259d26e166/Lib/argparse.py#L2227

Here it says that if there's a space in the string, it was meant to be a positional, and so the function returns `None`, causing it to not find the argument.

In conclusion, it seems to me that argparse is not, in fact, meant to handle quoted strings, or rather, strings where there are spaces.
History
Date User Action Args
2020-08-20 12:00:44vegarstisetrecipients: + vegarsti
2020-08-20 12:00:44vegarstisetmessageid: <1597924844.66.0.620020425851.issue41600@roundup.psfhosted.org>
2020-08-20 12:00:44vegarstilinkissue41600 messages
2020-08-20 12:00:44vegarsticreate