Message77686
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. |
|
Date |
User |
Action |
Args |
2008-12-12 20:10:16 | shawn.ashlee | set | recipients:
+ shawn.ashlee |
2008-12-12 20:10:16 | shawn.ashlee | set | messageid: <1229112616.18.0.592196405919.issue4645@psf.upfronthosting.co.za> |
2008-12-12 20:09:15 | shawn.ashlee | link | issue4645 messages |
2008-12-12 20:09:14 | shawn.ashlee | create | |
|