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 math_foo
Recipients Michal.Pomorski, bethard, math_foo
Date 2014-04-15.15:13:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1397574817.15.0.0669739786883.issue10523@psf.upfronthosting.co.za>
In-reply-to
Content
I've attached a patch making the changes I suggested, assuming that the current behaviour is desirable. It documents the behaviour of argparse on files with blank lines and changes the way the error message that argparse generates when encountering unrecognized arguments is generated.

When a blank line is included at the end of a file, the resulting error message is now: "argparse_example.py: error: unrecognized arguments: ''". This also makes it obvious when the problem is white space, e.g. if an argument has trailing spaces, this also makes that obvious.
History
Date User Action Args
2014-04-15 15:13:37math_foosetrecipients: + math_foo, bethard, Michal.Pomorski
2014-04-15 15:13:37math_foosetmessageid: <1397574817.15.0.0669739786883.issue10523@psf.upfronthosting.co.za>
2014-04-15 15:13:37math_foolinkissue10523 messages
2014-04-15 15:13:36math_foocreate