Issue1781
Created on 2008-01-10 02:42 by tlesher, last changed 2008-02-23 12:47 by facundobatista.
| File name |
Uploaded |
Description |
Edit |
Remove |
|
cfgparser.diff
|
draghuram,
2008-01-10 20:25
|
|
|
|
|
NEWS.diff
|
humitos,
2008-02-23 12:29
|
|
|
|
|
msg59652 - (view) |
Author: Tim Lesher (tlesher) |
Date: 2008-01-10 02:42 |
|
ConfigParser doesn't prevent "manually" adding a section named DEFAULT;
however, doing so creates a duplicate, inaccessible [DEFAULT] section in
the config file:
----
>>> import sys, ConfigParser
>>> c = ConfigParser.ConfigParser()
>>> c.add_section('DEFAULT')
>>> c.write(sys.stdout)
[DEFAULT]
>>> c.set('DEFAULT', 'color', 'yellow')
>>> c.write(sys.stdout)
[DEFAULT]
color = yellow
[DEFAULT]
----
It seems that the correct thing to do would be to disallow
add_section('DEFAULT').
|
|
msg59653 - (view) |
Author: Guido van Rossum (gvanrossum) |
Date: 2008-01-10 03:00 |
|
Care to provide a patch?
Otherwise this may be a good bug day candidate. The next one's Jan 19.
|
|
msg59666 - (view) |
Author: Christian Heimes (christian.heimes) |
Date: 2008-01-10 16:11 |
|
It's an easy task for the bug day unless you can provide a patch and an
unit test earlier.
|
|
msg59679 - (view) |
Author: Raghuram Devarakonda (draghuram) |
Date: 2008-01-10 20:25 |
|
Please see cfgparser.diff for the fix. It has tests and doc change.
|
|
msg59680 - (view) |
Author: Raghuram Devarakonda (draghuram) |
Date: 2008-01-10 20:32 |
|
I should add that the patch disallows not only 'DEFAULT' but all other
variants such as "Default" and "default". I am not entirely sure if my
description of this behaviour as "DEFAULT or any of it's
case-insensitive variants".
|
|
msg62722 - (view) |
Author: Manuel Kaufmann (humitos) |
Date: 2008-02-23 12:29 |
|
I tested the patch and works very well. I modified "Misc/NEWS" file
beacuse the change wasn't reported and I uploaded diff file
(NEWS.diff).
|
|
msg62724 - (view) |
Author: Facundo Batista (facundobatista) |
Date: 2008-02-23 12:47 |
|
Applied in r60976. Thank you all!
|
|
| Date |
User |
Action |
Args |
| 2008-02-23 12:47:04 | facundobatista | set | status: open -> closed nosy:
+ facundobatista resolution: accepted messages:
+ msg62724 |
| 2008-02-23 12:29:20 | humitos | set | files:
+ NEWS.diff nosy:
+ humitos messages:
+ msg62722 |
| 2008-01-15 21:01:30 | draghuram | set | keywords:
+ patch, easy |
| 2008-01-10 20:32:45 | draghuram | set | messages:
+ msg59680 |
| 2008-01-10 20:25:26 | draghuram | set | files:
+ cfgparser.diff nosy:
+ draghuram messages:
+ msg59679 |
| 2008-01-10 16:11:09 | christian.heimes | set | priority: normal nosy:
+ christian.heimes messages:
+ msg59666 |
| 2008-01-10 03:00:11 | gvanrossum | set | nosy:
+ gvanrossum messages:
+ msg59653 |
| 2008-01-10 02:42:49 | tlesher | create | |
|