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 shawn.ashlee
Recipients shawn.ashlee
Date 2008-12-12.20:09:14
SpamBayes Score 0.0022233322
Marked as misclassified No
Message-id <1229112616.18.0.592196405919.issue4645@psf.upfronthosting.co.za>
In-reply-to
Content
using .add_section() and .set() for the DEFAULT section adds it twice:

[user@srv ~]$ cat test_configparser.py 
#!/usr/bin/env python

import ConfigParser

a = ConfigParser.SafeConfigParser()

# borked
a.add_section('DEFAULT')
a.set('DEFAULT', 'foo', 'bar')

# working
a.add_section('working')
a.set('working', 'foo', 'bar')

b = open('testing', 'w')
a.write(b)
b.close()

[user@srv ~]$ python test_configparser.py 
[user@srv ~]$ cat testing 
[DEFAULT]
foo = bar

[DEFAULT]

[working]
foo = bar


Tested with 2.4 and 2.5, py3k no longer allows DEFAULT to be passed, so
this is a python < 3k issue.
History
Date User Action Args
2008-12-12 20:10:16shawn.ashleesetrecipients: + shawn.ashlee
2008-12-12 20:10:16shawn.ashleesetmessageid: <1229112616.18.0.592196405919.issue4645@psf.upfronthosting.co.za>
2008-12-12 20:09:15shawn.ashleelinkissue4645 messages
2008-12-12 20:09:14shawn.ashleecreate