parsing fails if keys have comment-like symbols
erwanp opened this issue ยท 1 comments
erwanp commented
Since #3 jsonc supports round-trip comments ๐ ; however it breaks if regular keys or values have #
or //
symbols
Example :
import json
import jsonc
jsonfilecontent = r"""{
"key_1":"PATH_TO_",
"key_#2":"PATH_WITH_//_"
}"""
json.loads(jsonfilecontent ) # works fine!
jsonc.loads(jsonfilecontent ) # fails because of "#" and "//"
jfcarter2358 commented
Great catch! I've just pushed version 1.0.1 to PyPI that fixes that and have updated the test cases to make sure it doesn't break in the future. Just run pip install jsoncparser==1.0.1
to update your version and you should be in good shape.