|
From: Michael F. <fuz...@vo...> - 2007-07-15 23:47:32
|
Hello Osmo, Thanks - that sounds like a bug and a fix. I'll add a test and get this in. Michael Foord http://www.voidspace.org.uk Osmo Salomaa wrote: > Hello, > > I use configobj and validate to store configurations in Gaupol [1]. One > of the things saved in the configuration file is a list of patterns the > user has searched for. I just noticed that if the user searches for > "#", the string gets saved in the configuration file with no escaping or > quoting and upon reading seems to be interpreted as an in-line comment. > This is especially problematic if "#" is the first item in the list, in > which case the value is interpreted as an empty string instead of an > empty list! > > I think the following patch to the "_quote" method should fix that. > > --- configobj.orig.py 2007-07-16 02:18:27.000000000 +0300 > +++ configobj.py 2007-07-16 02:20:46.000000000 +0300 > @@ -1674,7 +1674,7 @@ > value) > elif ((value[0] not in wspace_plus) and > (value[-1] not in wspace_plus) and > - (',' not in value)): > + (',' not in value) and ('#' not in value)): > quot = noquot > else: > if ("'" in value) and ('"' in value): > > [1] http://home.gna.org/gaupol/ > > Thanks, > Osmo Salomaa > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Configobj-develop mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/configobj-develop > > |