Comment 20 for bug 710410

Revision history for this message
Michael Foord (mfoord) wrote :

Ok, so as I suspected the problem is that the text being embedded in a value has triple quotes in it. As it only has triple double quotes (""") so ConfigObj *should* be using triple single quotes - so this is the particular bug that is biting you.

However for storing arbitrary data it is not safe to use multiline values that contain both triple single quotes and triple double quotes as ConfigObj then has no way to include the multiline value and will raise an exception when writing.

This is all *supposed* to be done in "_get_triple_quote" on line 1794 of your embedded version of configobj.py.

However - there is a horrible bug. tsquot and tdquot have [what look like give their names] the wrong values and configobj will *always* use the wrong quotes when quoting values that have triple quotes in them! Aargh...

So, swapping over lines 1798 and 1800 of *your* version of configobj.py will fix the immediate problem - but potentially still leave you with a difficulty where values have *both* triple double quotes and triple single quotes.

I'll fix the bug upstream of course.