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 r.david.murray
Recipients Arfrever, barry, benjamin.peterson, bethard, chris.jerdonek, georg.brandl, python-dev, r.david.murray
Date 2012-09-12.10:39:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1347446378.45.0.756311283048.issue15906@psf.upfronthosting.co.za>
In-reply-to
Content
I agree with Chris here.  We also need to add the various tests he's come up with.  IMO the easiest way to restore the original behavior and the preserve the fixes is to make the following single line change:

diff --git a/Lib/argparse.py b/Lib/argparse.py
--- a/Lib/argparse.py
+++ b/Lib/argparse.py
@@ -1962,7 +1962,8 @@
                     # only if it was defined already in the namespace
                     if (action.default is not None and
                         hasattr(namespace, action.dest) and
-                        action.default is getattr(namespace, action.dest)):
+                        action.default is getattr(namespace, action.dest) and
+                        isinstance(action.default, str)):
                         setattr(namespace, action.dest,
                                 self._get_value(action, action.default))
History
Date User Action Args
2012-09-12 10:39:38r.david.murraysetrecipients: + r.david.murray, barry, georg.brandl, bethard, benjamin.peterson, Arfrever, chris.jerdonek, python-dev
2012-09-12 10:39:38r.david.murraysetmessageid: <1347446378.45.0.756311283048.issue15906@psf.upfronthosting.co.za>
2012-09-12 10:39:17r.david.murraylinkissue15906 messages
2012-09-12 10:39:17r.david.murraycreate