[issue10387] ConfigParser's getboolean method is broken

2010-11-11 Thread Felix Laurie von Massenbach
New submission from Felix Laurie von Massenbach fantasi...@gmail.com: If the config file has a boolean formatted as either True or False, python raises an attribute error when doing str.lower() on it. In my code I've worked around this in the following way: class MyConfigParser

[issue10387] ConfigParser's getboolean method is broken

2010-11-11 Thread Felix Laurie von Massenbach
Felix Laurie von Massenbach fantasi...@gmail.com added the comment: Oops, that was the broken first version. Let's try again: class MyConfigParser(ConfigParser.RawConfigParser): def getboolean(self, section, option): result = self.get(section, option) try: trues

[issue10387] ConfigParser's getboolean method is broken

2010-11-11 Thread Felix Laurie von Massenbach
Felix Laurie von Massenbach fantasi...@gmail.com added the comment: Perhaps I don't understand fully, but I am reading, for example, option = True from a config file. When doing this getboolean raises: AttributeError: 'bool' object has no attribute 'lower' Is it intended that you cannot store

[issue10387] ConfigParser's getboolean method is broken

2010-11-11 Thread Felix Laurie von Massenbach
Felix Laurie von Massenbach fantasi...@gmail.com added the comment: Ok, so I understand the issue, but why doesn't the set method simply convert to a string? from ConfigParser import RawConfigParser from StringIO import StringIO parser = RawConfigParser() config = [section] test = True