1

I am using http://www.voidspace.org.uk/python/configobj.html to parse my configuration and it looks like it doesnt allow you to do this:

[section 1]

    [[sub-section 1]]
    # this is in section 1
    keyword1 = value1
    keyword2 = value2

    [[sub-section 2]]
    # this is in section 1
    keyword1 = value1
    keyword2 = value2

It crashes with a:

ParsingError: File contains parsing errors:

If I want to have a list of configurations, like a list of ftp configurations I must provide some useless settings to the parent so it doenst complain like this:

[section 1]
    amIUseless = yesYouAre
    [[sub-section 1]]
    # this is in section 1
    keyword1 = value1
    keyword2 = value2

    [[sub-section 2]]
    # this is in section 1
    keyword1 = value1
    keyword2 = value2

Is this intended? am I doing anything wrong? Can I avoid adding that useless setting?

lapinkoira
  • 8,320
  • 9
  • 51
  • 94
  • Your first configuration file works fine for me. Usually when ConfigObj fails, it gives you a line number and some details of where the parsing went wrong. Was there anything else? – TomK Feb 06 '17 at 22:20
  • Hello, I am trying now with configobj==5.0.6 and the first conf file is working fine. Possibly there were other issues in the parsing as you said not related to this example – lapinkoira Feb 07 '17 at 10:18

0 Answers0