Senthil Kumaran <orsent...@gmail.com> added the comment: 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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10387> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com