]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
#12776,#11839: call argparse type function only once.
authorR David Murray <rdmurray@bitdance.com>
Sat, 1 Sep 2012 02:45:20 +0000 (22:45 -0400)
committerR David Murray <rdmurray@bitdance.com>
Sat, 1 Sep 2012 02:45:20 +0000 (22:45 -0400)
commit6fb8fb17bff87fdd5e738430502f34f8729766e3
tree3613de4ab17a379161862e2bfece5cf734b1b5a8
parent2a0fb147ec7149b732083adedb6c6d1ba5ef8ebb
#12776,#11839: call argparse type function only once.

Before, the type function was called twice in the case where the default
was specified and the argument was given as well.  This was especially
problematic for the FileType type, as a default file would always be
opened, even if a file argument was specified on the command line.

Patch by Arnaud Fontaine, with additional test by Mike Meyer.
Lib/argparse.py
Lib/test/test_argparse.py
Misc/ACKS
Misc/NEWS