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 martin.panter
Recipients Marshall Giguere, martin.panter
Date 2017-03-01.05:28:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1488346107.78.0.509589316751.issue29681@psf.upfronthosting.co.za>
In-reply-to
Content
It's not clear what you expected the behaviour to be. A function cannot both raise an exception and return a value.

In any case, you are correct in saying "the next option, '-d', is taken as the argument." I do not think this is a bug. See <http://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html> for the Posix specification of "getopt".

Perhaps you are confused by a bug or quirk of "argparse", where it treats most CLI arguments that begin with a dash specially, even if according to Posix they would be associated with an option. See Issue 9334.
History
Date User Action Args
2017-03-01 05:28:27martin.pantersetrecipients: + martin.panter, Marshall Giguere
2017-03-01 05:28:27martin.pantersetmessageid: <1488346107.78.0.509589316751.issue29681@psf.upfronthosting.co.za>
2017-03-01 05:28:27martin.panterlinkissue29681 messages
2017-03-01 05:28:27martin.pantercreate