]> granicus.if.org Git - python/commit
#12776,#11839: call argparse type function only once.
authorR David Murray <rdmurray@bitdance.com>
Sat, 1 Sep 2012 03:15:28 +0000 (23:15 -0400)
committerR David Murray <rdmurray@bitdance.com>
Sat, 1 Sep 2012 03:15:28 +0000 (23:15 -0400)
commit201018718fc55fada8fd159b86bc038c3d297597
tree98c4e56a7b88c56873d52157c6faf5bd2ea17421
parentcd366620a9bb912e4ab437afdd046ea725bb0799
#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