GithubHelp home page GithubHelp logo

Comments (6)

zhiburt avatar zhiburt commented on August 30, 2024

Also might be related as I also get on one test

thread 'python' panicked at 'assertion failed: `(left == right)`
  left: `4`,
 right: `0`', /home/mzhiburt/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-lite-1.12.0/src/io.rs:1700:13

from futures-lite.

zhiburt avatar zhiburt commented on August 30, 2024

And ongoing question, if you don't mind.
Is it safe to do the following.

future::poll_once(self.inner.read(buf)).await

Where inner is a BufRead<async_file::File>;

Because it just don't work, the buffer is never read 😞

When I use std::fs::File with O_NONBLOCK it works good.

from futures-lite.

zhiburt avatar zhiburt commented on August 30, 2024

Testing it in a different project and read_line works fine. ...

from futures-lite.

zhiburt avatar zhiburt commented on August 30, 2024

I can state that it sometimes fails and sometimes not.

p.read_line(&mut msg).await.unwrap(); // works
***
p.read_line(&mut msg).await.unwrap(); // panic on assert_debug

from futures-lite.

zhiburt avatar zhiburt commented on August 30, 2024

So moving from async-fs to async-io cause a different issue on the same code

thread 'python' panicked at 'assertion failed: buf.is_empty()', /home/mzhiburt/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-lite-1.12.0/src/io.rs:1699:13

from futures-lite.

zhiburt avatar zhiburt commented on August 30, 2024

Running it in --release to disable debug_asserts drops 6 characters where were available if we would read it in a sync mode.

from futures-lite.

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.