Caelyn McAulay added the comment:

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.

----------
keywords: +patch
Added file: http://bugs.python.org/file34875/argparse_blanklines.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10523>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to