Package: python-configobj
Version: 4.4.0-1
Severity: normal

Hello,

thanks for maintaining ConfigObj.

I'm using ConfigObj merge operations and list_value=False, and I've
found that in some cases ConfigObj adds spurious double quotes artifacts
to parsed string values.

This is the code that reproduces the problem:

    from configobj import ConfigObj
    from StringIO import StringIO
    
    # A normal ConfigObj
    co = ConfigObj()
    # Note: this is the same as doing:
    # co = ConfigObj(list_values = True)
    # If I use a ConfigObj with list_values=False, the problem does not
    # show.
    
    # Create a new section
    co["test"] = dict()
    
    # Merge in options with list values turned off
    co1 = ConfigObj(list_values = False)
    co1["foo"] = "bar, baz"
    co["test"].merge(co1)
    
    # Write it out
    buf = StringIO()
    co.write(buf)
    
    # Read it again
    buf1 = StringIO(buf.getvalue())
    co2 = ConfigObj(infile = buf1, list_values = False)
    
    # test/foo gets extra double quotes
    print co2["test"]["foo"]

The last line prints:

    "bar, baz"

With double quotes: the double quotes have been parsed as part of the
string, rather than stripped as syntactic sugar of the config file
syntax.


Ciao,

Enrico

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.21-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages python-configobj depends on:
ii  python-support                0.6.4      automated rebuilding support for p

python-configobj recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to