ssato / python-anyconfig

Python library provides common APIs to load and dump configuration files in various formats
MIT License
279 stars 31 forks source link

Properties file breaks while parsing line ending with "\" (line breaker) #56

Closed ajays20078 closed 7 years ago

ajays20078 commented 7 years ago

Contents of one.properties

key=\
val1,\
val2,\
val3
>>> a = anyconfig.load("one.properties")
>>> a
{'key=key=val1,key=key': 'val1,val2,val3'}

Where as it works well with other properties parser.

>>> p = Properties()
>>> p.load(open('one.properties'))
>>> p
<pyjavaproperties.Properties object at 0x107fac1d0>
>>> p.list()
-- listing properties --
key=val1,val2,val3
>>> print p
{key=val1,val2,val3}

Line break is causing issue with anyconfig parser.

ajays20078 commented 7 years ago

Moving this line before this line might fix it?

ssato commented 7 years ago

Excuse me to late response.

Thanks a lot for you reports and fix suggestion! Could you please wait for a while?I want to look closely into the causes.

ssato commented 7 years ago

I confirmed that you're right and commit the fix b804c61. Thanks a lot!

ajays20078 commented 7 years ago

Thanks! yeah its works. Closing the issue.