> I agree, but that was a trivial example to demonstrate the problem.
> Writing the file out to disk writes it exactly as set(), causing a get()
> to fail just the same later.

No... The above statement is not true.

The following code:

[code]
from ConfigParser import *
import sys

cp = SafeConfigParser()
cp.add_section("sect")
cp.set("sect","opt","hello%world")

cp.write(sys.stdout)
[/code]

Produces this output:
[sect]
opt = hello%world

The write method never calls get. However, when you read the file that
was output by the above code using .get(...) will raise an error. You
can avoid that error by setting the optional 'raw' parameter to True.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to