Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing incorrectly to nested array when there is comment between two lines with same key #3

Closed
bpradeep20 opened this issue Jul 9, 2018 · 2 comments

Comments

@bpradeep20
Copy link

I am using following configuration to parse

<main>
    <body>
        key value

        # comment
        key value
        key value
    </body>
</main>

and expecting result to be

{  
   "main":{  
      "body":{  
         "key":[  
            "value",
            "value",
            "value"
         ]
      }
   }
}

but parsing result of the library is

{  
   "main":{  
      "body":{  
         "key":[  
            "value",
            [  
               "value",
               "value"
            ]
         ]
      }
   }
}

Here is code used for parsing:

from apacheconfig import *
options = {
    'lowercasenames': True
}
with make_loader(**options) as loader:
    config = loader.load('test.conf')
@etingof
Copy link
Owner

etingof commented Jul 9, 2018

Hey, thanks for reporting this bug! This merging duplicates business is quite messy.

Let's try #4 to see if it works for you?

@etingof
Copy link
Owner

etingof commented Jul 14, 2018

Hopefully, fixed in master.

@etingof etingof closed this as completed Jul 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants