ConfigParser: values with ";" and the value blank

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kai

    #1

    ConfigParser: values with ";" and the value blank

    Hello,

    I use the ConfigPaserver from Python.
    how can I use/save/read values with ";" (start comment) and the value
    blank?
    When I write (set) my config file often the part behind the ";"
    disappears.
    e.g.
    myKey = startMyValue ; endMyValue


    Thank's for your hints, Kai

  • André Malo

    #2
    Re: ConfigParser: values with ";&quot ; and the value blank

    * kai wrote:
    [color=blue]
    > I use the ConfigPaserver from Python.
    > how can I use/save/read values with ";" (start comment) and the value
    > blank?
    > When I write (set) my config file often the part behind the ";"
    > disappears.
    > e.g.
    > myKey = startMyValue ; endMyValue[/color]

    You can't. The ConfigParser treats " ;" as inline comment delimiter. This is
    undocumented (afaik) and badly hardcoded into the module. The time I found
    this out, I simply hacked my own (way more simple) parser module
    replacement.

    Anyway, you might try http://www.voidspace.org.uk/python/configobj.html
    instead. I've never used it myself, though.

    nd
    --
    Gib' mal folgendes in die Kommandozeile ein (und einen Moment warten):

    net send localhost "Buuuh!"
    Na, erschreckt? -- Markus Becker in mpdsh

    Comment

    Working...