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

Crudini omits keys/params #39

Closed
thorstenkampe opened this issue Nov 23, 2016 · 3 comments
Closed

Crudini omits keys/params #39

thorstenkampe opened this issue Nov 23, 2016 · 3 comments

Comments

@thorstenkampe
Copy link

Crudini omits certain keys in sections like remote (see below); tested on Linux and Cygwin. It looks like the underlying iniparse library is the culprit.

Can you confirm the issue and tell which kind of keys are dropped? If this is potentially occuring with a multitude of key names I would have to drop Crudini for my current project.

> cat transport.ini                                                                                                                            [Transport]
local  = /tmp
remote = /tmp/TEST.sh
upload = false
> crudini --get --format sh transport.ini Transport
local=/tmp
upload=false
@pixelb
Copy link
Owner

pixelb commented Nov 23, 2016

Whoa that's a crazy bug.
I confirmed it's in iniparse with:

import iniparse
from cStringIO import StringIO
p=iniparse.ConfigParser()
p.readfp(StringIO("[1]\nremote=1\nemote=2"))
print p.items(p.sections()[0])

I don't see "remote" mentioned in the iniparse source,
so I'll need to dig a bit...

@pixelb
Copy link
Owner

pixelb commented Nov 23, 2016

Whoa, any line that starts with "rem" is treated as a comment. Ouch.

pixelb added a commit that referenced this issue Nov 23, 2016
iniparse defaults to treating lines starting with "rem" as comments.
Therefore change the default comment matching scheme to allow
parameters like "remote = 1" for example.

Also allow '%' as a comment character which will then allow
processing of mercurial config files which can use "%include"
and "%unset" directives.

Fixes issue #39
@pixelb pixelb closed this as completed Nov 23, 2016
@thorstenkampe
Copy link
Author

Thanks for the quick fix. Appreciated!

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