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

Handle ConfigValues and ConfigSubstitution in HOCONConverter.to_hocon #192

Merged
merged 2 commits into from
Nov 15, 2018

Conversation

ChristopheDuong
Copy link
Contributor

As also mentioned by Ivan@renardeinside on gitter, I encountered this bug and made a fix for it (plus a test):

Hi everyone.
I found something strange in HOCONConverter.convert(config,"hocon").
Probably i haven't enough understanding, but if you want to convert come config with unresolved substitution, you got strange result.
Suppose, you have file like this

parameter = ${substition.v1}

Then you parse this file and you won't resolve substitution:

config = ConfigFactory.parse_file("example.conf",resolve=False)

Then if you convert this config you got this result code:

print(HOCONConverter.convert(config,"hocon"))

output:

parameter = [ConfigValues: [ConfigSubstitution: substition.v1]]

But probably the result should be:

parameter = ${substition.v1}

@coveralls
Copy link

coveralls commented Nov 12, 2018

Coverage Status

Coverage decreased (-0.4%) to 96.412% when pulling 40dc608 on ChristopheDuong:master into 0390324 on chimpler:master.

@darthbear
Copy link
Member

Thank you @ChristopheDuong for your PR!

@darthbear darthbear merged commit a38024b into chimpler:master Nov 15, 2018
@darthbear
Copy link
Member

Thanks @ChristopheDuong for your contribution. Your fix was pushed to pyhocon==0.3.48

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

Successfully merging this pull request may close these issues.

3 participants