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
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
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
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