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 melicertes
Recipients
Date 2004-06-16.16:36:16
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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.

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