Message170365
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)) |
|
Date |
User |
Action |
Args |
2012-09-12 10:39:38 | r.david.murray | set | recipients:
+ r.david.murray, barry, georg.brandl, bethard, benjamin.peterson, Arfrever, chris.jerdonek, python-dev |
2012-09-12 10:39:38 | r.david.murray | set | messageid: <1347446378.45.0.756311283048.issue15906@psf.upfronthosting.co.za> |
2012-09-12 10:39:17 | r.david.murray | link | issue15906 messages |
2012-09-12 10:39:17 | r.david.murray | create | |
|