Git Product home page Git Product logo

Comments (4)

rtobar avatar rtobar commented on July 21, 2024 1

@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 python backend doesn't recognise these cases properly, so yes, this can be improved. On the other hand this is the slowest backend; the others do raise IncompleteJSONError on these cases, so you might be better off using those anyway. I will still improve the python backend to detect these cases and raise the appropriate exception.

EDIT: almost all other backends raise an IncompleteJSONError exception. The yajl backend (which is deprecated) doesn't, but it won't be repaired either.

from ijson.

rtobar avatar rtobar commented on July 21, 2024 1

A fix for this is now on the master branch; now the python backend recognises incomplete JSON tokens like tru or nu as such and raises an IncompleteJSONError exception. A new version with this fix will be released to PyPI hopefully in the next day or so, but until then you can either install directly from GitHub or use a different backend.

from ijson.

rtobar avatar rtobar commented on July 21, 2024 1

ijson 3.1.4 is now available on PyPI

from ijson.

harpener avatar harpener commented on July 21, 2024

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.

from ijson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.