Comment 2 for bug 86838

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 86838] Re: configuration values are not properly escaped, with hash signs being treated as comments

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

James Henstridge пишет:
| ** Summary changed:
|
| - locations.conf gets rewritten, dropping necessary quotes
| + configuration values are not properly escaped, with hash signs being treated as comments
|
| ** Changed in: bzr
| Status: New => Confirmed
|

It's actually problem in ConfigObj library. I talked with Michael Foord about
this issue and this bug is fixed in upstream now.

Here is quote from our conversation:

- -------- Исходное сообщение --------
Тема: Re: ConfigObj: inline comments considered harmful
Дата: Tue, 15 Jan 2008 23:13:15 +0000
От: Michael Foord <email address hidden>
Кому: Alexander Belchenko <email address hidden>

Hello Alexander,

This problem is now fixed in SVN.

http://svn.pythonutils.python-hosting.com/trunk/pythonutils/

I'm making some further changes (minor bugfixes and possibly a couple of
new methods 'reload' and 'restore_defaults'). After that a new release
will follow shortly.

Many Thanks

Michael Foord

Alexander Belchenko wrote:
| Michael Foord пишет:
|> <email address hidden> wrote:
|>> Some one has sent you a message via your contact form. They filled
|>> in the
|>> following values :
|>>
|>> comment = We are using ConfigObj in Bazaar project and many bzr
|>> plugins. Recently I discover that your support of inline comments
|>> can create problems with write and then read back string with '#'
|>> sign in it.
|>>
|>> E.g. if I save option from my program, e.g.:
|>>
|>> message = bug #123 fixed
|>>
|>> and then I tru to read back config file, I get only 'bug' as value
|>> of 'message' option.
|>>
|>> It's bad. Any ideas why ConfigObj works in this way?
|>>
|> In order to allow inline comments that aren't part of the value.
|>
|>> Please, don't tell me that we must escape # signs when we write them
|>> to config, and unescape when read back. It's ugly.
|>>
|>
|> You can probably do:
|>
|> message = "bug #123 fixed"
|
| How this possible to do using ConfigObj API?
|

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHpqD+zYr338mxwCURAsITAJ4ww/TRVzajjwaMPxsV94MGKHu/1gCeKTXe
JNrxivCkJm8OstiwGCmQSCY=
=CIEw
-----END PGP SIGNATURE-----