-
Notifications
You must be signed in to change notification settings - Fork 51
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
IncompleteJSONError is not recognized for null and boolean values #42
Comments
@harpener if I understand correctly, your concern is that the type of exception raised by the code is not what you expected, and therefore you can't recognize the particular problem of an incomplete JSON document, right? You are right that the EDIT: almost all other backends raise an |
As pointed out in #42, the python backend failed to properly recognise valid but incomplete JSON content when the incomplete bits were the beginning of the "true", "false" or "null" tokens. This commit adds support for recognising these cases, and adds test cases that will ensure these cases are properly recognised by all backends, including the python one. Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
As pointed out in #42, the python backend failed to properly recognise valid but incomplete JSON content when the incomplete bits were the beginning of the "true", "false" or "null" tokens. This commit adds support for recognising these cases, and adds test cases that will ensure these cases are properly recognised by all backends, including the python one. Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
A fix for this is now on the |
Thanks for the fix. I haven't even been able to import any of the yajl backends on local Windows or production Linux environments, so I can't say how they behave. But the performance is not that important for now. |
ijson 3.1.4 is now available on PyPI |
Hi guys,
we are using this library to be able to parse incomplete JSON, specifically its Python backend.
We noticed that sometimes it raises
UnexpectedSymbol
instead ofIncompleteJSONError
and after some investigation, we found out that the problem is that given JSON ended with incompletenull
ortrue
orfalse
value. E.g.{"a": n
. It seems that the lexer's state machine does not recognize it.Do you think this is a valid case and if so, can it be fixed?
Thank you for your response.
The text was updated successfully, but these errors were encountered: