Code review comment for lp:~bialix/bzr/2.2-configobj

Revision history for this message
John A Meinel (jameinel) wrote :

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

I believe you provide this against bzr 2.3 which Martin already
approved. Is that correct? If so, I think it is fine to apply it to
2.2, and merge-forward from there.

I believe the official policy is that we will only focus on
maintaining 1 stable branch, which is now bzr-2.3. However, if you
want it against 2.2, we can certainly do so.

Did we get a patch for this sent to upstream configobj?

 merge: approve

John
=:->

On Sun, Feb 20, 2011 at 7:59 AM, Alexander Belchenko <<email address hidden>
<mailto:<email address hidden>>> wrote:

    Alexander Belchenko has proposed merging
    lp:~bialix/bzr/2.2-configobj into lp:bzr/2.2.

    Requested reviews:
     bzr-core (bzr-core)

    For more details, see:
    https://code.launchpad.net/~bialix/bzr/2.2-configobj/+merge/50507
    <https://code.launchpad.net/%7Ebialix/bzr/2.2-configobj/+merge/50507>

    Fixed bug in the bundled copy of ConfigObj with quoting of triple
    quotes
    in the value string. Fix suggested by ConfigObj's author Michael
    Foord.

    This patch provides the fix to 2.2 series, should I provide the
    similar patches for 2.3 and bzr.dev, or it will be merged to other
    series by some integration process?
    --
    https://code.launchpad.net/~bialix/bzr/2.2-configobj/+merge/50507
    <https://code.launchpad.net/%7Ebialix/bzr/2.2-configobj/+merge/50507>
    Your team bzr-core is requested to review the proposed merge of
    lp:~bialix/bzr/2.2-configobj into lp:bzr/2.2.

    === modified file 'NEWS'
    --- NEWS 2011-02-09 04:16:55 +0000
    +++ NEWS 2011-02-20 13:59:00 +0000
    @@ -36,6 +36,10 @@
     Internals
     *********

    +* Fixed bug in the bundled copy of ConfigObj with quoting of
    triple quotes
    + in the value string. Fix suggested by ConfigObj's author
    Michael Foord.
    + (Alexander Belchenko, #710410)
    +
     Testing
     *******

    === modified file 'bzrlib/tests/test_config.py'
    --- bzrlib/tests/test_config.py 2010-07-21 03:07:02 +0000
    +++ bzrlib/tests/test_config.py 2011-02-20 13:59:00 +0000
    @@ -246,6 +246,27 @@
            co2 = config.ConfigObj(lines)
            self.assertEqual(co2['test'], 'foo#bar')

    + def test_triple_quotes(self):
    + # Bug #710410: if the value string has triple quotes
    + # then ConfigObj versions up to 4.7.2 will quote them wrong
    + # and won't able to read them back
    + triple_quotes_value = '''spam
    +""" that's my spam """
    +eggs'''
    + co = config.ConfigObj()
    + co['test'] = triple_quotes_value
    + # another bug in ConfigObj:
    + # method co.write() without arguments produces list of lines
    + # one option per line, and multiline values are not split
    + # across multiple lines,
    + # and that breaks the parsing these lines back by ConfigObj
    + outfile = StringIO()
    + co.write(outfile=outfile)
    + lines = outfile.getvalue().splitlines()
    + # now we're trying to read it back
    + co2 = config.ConfigObj(lines)
    + self.assertEquals(triple_quotes_value, co2['test'])
    +

     erroneous_config = """[section] # line 1
     good=good # line 2

    === modified file 'bzrlib/util/configobj/configobj.py'
    --- bzrlib/util/configobj/configobj.py 2009-04-17 22:24:54 +0000
    +++ bzrlib/util/configobj/configobj.py 2011-02-20 13:59:00 +0000
    @@ -1795,9 +1795,9 @@
            if (value.find('"""') != -1) and (value.find("'''") != -1):
                raise ConfigObjError('Value "%s" cannot be safely
    quoted.' % value)
            if value.find('"""') == -1:
    + quot = tsquot
    + else:
                quot = tdquot
    - else:
    - quot = tsquot
            return quot

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

iEYEARECAAYFAk1mlPIACgkQJdeBCYSNAAPwVACdHShRF1lQH3pPK8ZEt9CTc6X1
uTIAoLOIc9KGYKJarbuTaiIEbeHOeLdw
=Zu0e
-----END PGP SIGNATURE-----

review: Approve

« Back to merge proposal