Author melicertes
Date 2004-06-16.16:36:16
SpamBayes Score
Marked as misclassified
ConfigParser.getboolean() fails if it falls back to a
default value, and the value passed in was a boolean
object (instead of a string) because it unconditionally
does v.lower().
This should be fixed; there's something un-Pythonic
about expecting a boolean value but not being able to
actually provide a boolean as the default.

I've attached a patch (against 2.3.4c1; should apply to
2.3.4, I think) which makes the v.lower() conditional
on v being a string, and adds bool(True), bool(False),
int(1), and int(0) to _boolean_states.

Alternative resolution:  change the documentation to
specify that /only/ strings should be passed in the
defaults dictionary.  Less Pythonic.

Date User Action Args
2007-08-23 16:08:11adminlinkissue974019 messages
2007-08-23 16:08:11admincreate