ConfigParser and .ini files

super_banane at yahoo.com super_banane at yahoo.com
Fri Jan 21 11:35:14 EST 2000


Hello:

The ConfigParser class in the default Python libraries
does not support comments given on the value lines, separated
by a semicolon, such as:

[Section]
keyword = value ; put your comments here

The value as it is returned is:
"value ; put your comments here"
... which is not really what you expect.

Adding one line of code in the ConfigParser class
adds support for this feature. Any chance of submitting
this for the next Python release?

file ConfigParser.py line 311, add:
optval = string.split(optval)[0]
(before optname=string.strip(optval))

Cheers
--
Nicolas


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list