-
Notifications
You must be signed in to change notification settings - Fork 121
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
Issue parsing HOCON with newline #324
Comments
The problem is likely due to implicit parsing of dates... and likely due to a change in pyparsing. Here is an minimal example: from pyhocon import ConfigFactory
val = ConfigFactory.parse_string("""
a {
y_min: 3
y_max: 42
}
""")
assert val
assert val["a"]
print(val)
assert "y_min" in val["a"].keys()
assert "y_max" in val["a"].keys()
assert val["a"]["y_min"] == 3
assert val["a"]["y_max"] == 42 pyhocon==
|
dates were not correctly parsed with recent versions of pyparsing because of usage of White() White is actually not needed, added some tests to avoid issues detected in chimpler#324
@lannuttia fix in #326 |
@lannuttia I think it has been fixed in 0.3.61 |
I can confirm that the issue that I was seeing was resolved after updating to v0.3.61. I appreciate the help here! |
@lannuttia Then, you might close the issue :-) |
Alright, it's closed |
This PR undoes a workaround for chimpler/pyhocon#324 that I added in one of the tests and also updates the pyhocon dependency to exclude the problematic version.
In
0.3.59
, parsing the following would work fine.As of
0.3.60
, running that same script would result in the following exception being thrown.Interestingly enough, if I add a space in between the \n and the 'd', It parses without error again. I suspect that since the 'd' comes immediately after the newline, it is erroneously being interpreted as a control character but I don't really know.
The text was updated successfully, but these errors were encountered: