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

HOCONConverter.to_properties escapes equals sign in quoted string and removes quotes #78

Open
alexey-terentiev opened this issue Apr 21, 2016 · 2 comments
Assignees
Labels

Comments

@alexey-terentiev
Copy link

alexey-terentiev commented Apr 21, 2016

Config:

foo = "-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="

Code:

from pyhocon import ConfigFactory
from pyhocon import HOCONConverter

config = ConfigFactory.parse_file("test.conf", resolve=False)
print HOCONConverter.to_properties(config)

Result:

foo = -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath\=

Expected result:

foo = "-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="
@darthbear darthbear added the bug label Apr 24, 2016
@darthbear darthbear self-assigned this Apr 24, 2016
@darthbear
Copy link
Member

Do we want to keep the quotes? In HOCON, double quotes are optional so after parsing, the quotes are gone. But I can fix the \= easily. Thanks.

@alexey-terentiev
Copy link
Author

alexey-terentiev commented Apr 25, 2016

Well yes, I'd like to keep the quotes, turning off escaping inside them.

Quoted strings may always be used as an alternative when you need to write a character that is not permitted in an unquoted string.

Moreover, in current implementation it should also escape special symbols like : in unquoted strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants