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 lukasz.langa
Recipients Felix.Laurie.von.Massenbach, lukasz.langa
Date 2010-11-11.14:22:24
SpamBayes Score 8.090306e-12
Marked as misclassified No
Message-id <1289485346.38.0.078755363134.issue10387@psf.upfronthosting.co.za>
In-reply-to
Content
No problem Felix. But look:

Python 2.7 (r27:82500, Sep 24 2010, 12:26:28)
[GCC 4.3.4 20090804 (release) 1] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> config = """
... [section]
... does_it_work = True
... is_it_broken = False
... """
>>> from ConfigParser import RawConfigParser
>>> from StringIO import StringIO
>>> parser = RawConfigParser()
>>> sio = StringIO(config)
>>> parser.readfp(sio)
>>> parser.sections()
['section']
>>> parser.get('section', 'does_it_work')
'True'
>>> parser.get('section', 'is_it_broken')
'False'
>>> parser.getboolean('section', 'does_it_work')
True
>>> parser.getboolean('section', 'is_it_broken')
False

So, reading configuration options from files definitely works. And as you see in the first get() pair, it stores values internally as strings.
History
Date User Action Args
2010-11-11 14:22:26lukasz.langasetrecipients: + lukasz.langa, Felix.Laurie.von.Massenbach
2010-11-11 14:22:26lukasz.langasetmessageid: <1289485346.38.0.078755363134.issue10387@psf.upfronthosting.co.za>
2010-11-11 14:22:24lukasz.langalinkissue10387 messages
2010-11-11 14:22:24lukasz.langacreate