Git Product home page Git Product logo

Comments (5)

MKuranowski avatar MKuranowski commented on July 21, 2024 1

Thank you very much, everything's working as intended :)

from ijson.

rtobar avatar rtobar commented on July 21, 2024

@MKuranowski thanks for reporting. I can locally reproduce too, which is good (in a way!), but oddly it didn't happen with the unit tests. I'll have to study a bit closer what's going on.

from ijson.

rtobar avatar rtobar commented on July 21, 2024

Found the problems (there were two actually), both of course in the yajl2_c backend only:

  • There was an issue if the first call to await f.read() resulted on a yield to the scheduler. This wasn't caught by our unit tests because the simple class we use for testing doesn't yield execution when read is called. After adding an await asyncio.sleep(0) in there the unit tests starting failing in the same way your test script does. This is now fixed, and I pushed the fix to the master branch.
  • After fixing that, a second problem came up. This one has to do with the fact that aiofiles implements the read operation (and most of them, I think) using @types.coroutines decorations rather than async def function definitions. The ijson C code wasn't prepared for that case (they are intrinsically different at this level), and I'll need to have a closer inspection yet into how to properly support both. I have something that seems to be working, but is still not fully stable, so I'd rather not push that fix yet.

I don't think I'll be able to tackle this second until early next week though. In the meanwhile you can workaround this by defining your own thin wrapper around aiofiles.open so it defines an async def read coroutine, that should work.

from ijson.

rtobar avatar rtobar commented on July 21, 2024

I just pushed the last set of changes to the master branch that fix the second problem (correctly dealing with @type.coroutine awaitable read functions in the C backend), plus a new set of unit tests that ensure this will not creep up again. @MKuranowski please give this a try to confirm that things are working as intended.

A new release will follow probably tomorrow, time permitting.

from ijson.

rtobar avatar rtobar commented on July 21, 2024

A new 3.1.1 release of ijson including these fixes is now available on PyPI.

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.