#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.
diff --git a/Misc/ACKS b/Misc/ACKS
index d8ddd32..2a93d66 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -271,6 +271,7 @@
Frederik Fix
Matt Fleming
Hernán Martínez Foffani
+Arnaud Fontaine
Michael Foord
Amaury Forgeot d'Arc
Doug Fort
diff --git a/Misc/NEWS b/Misc/NEWS
index f13499f..bdfd0b7 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -98,6 +98,12 @@
Library
-------
+- Issue #12776,#11839: call argparse type function (specified by add_argument)
+ 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.
+
- Issue #13370: Ensure that ctypes works on Mac OS X when Python is
compiled using the clang compiler