Message121128
On Sat, Nov 13, 2010 at 01:20:45AM +0000, Łukasz Langa wrote:
> You think wrong. Try it.
Okay, I get it. Coercing would be a bad idea in RawConfigParser
because there are cases where get method can have raw=True and
coercing would break those behaviors.
The way the OP expressed it, it looked like a bug to me.
Here is one way, the OP's concern can be resolved.
Index: Lib/configparser.py
===================================================================
--- Lib/configparser.py (revision 86441)
+++ Lib/configparser.py (working copy)
@@ -892,6 +892,8 @@
"""
if value.lower() not in self.BOOLEAN_STATES:
raise ValueError('Not a boolean: %s' % value)
+ if str(value) in self.BOOLEAN_STATES:
+ return self.BOOLEAN_STATES[str(value)]
return self.BOOLEAN_STATES[value.lower()]
def _validate_value_type(self, value):
But this seems specific to the special case as this bug is raised for.
I am personally, +0 for this too. |
|
Date |
User |
Action |
Args |
2010-11-13 10:38:26 | orsenthil | set | recipients:
+ orsenthil, eric.araujo, lukasz.langa, Felix.Laurie.von.Massenbach |
2010-11-13 10:38:24 | orsenthil | link | issue10387 messages |
2010-11-13 10:38:24 | orsenthil | create | |
|