Code Monkey home page Code Monkey logo

Comments (2)

takluyver avatar takluyver commented on August 22, 2024

Hmm, it's annoying that closerange isn't implemented more efficiently, but I guess there's not much I can do about that.

The difficulty with using subprocess is that at the heart of ptyprocess, we call forkpty() rather than fork(). That's a different call all the way down to libc. There is a fallback implementation using fork(), with comments indicating it's for Solaris, but I don't know how well-tested it is, and I'm not confident in my abilities to write properly bulletproof low-level system code like this.

ptyprocess is also (as a component pulled out of pexpect), old code which has, over the years, attempted to support many platforms. I'm reluctant to make major changes to it, because I don't know all the platforms and use cases where it's running in the wild. So maybe you're better off writing a new module under a different name to do the same thing without all the legacy concerns. I'm happy to link to it from the docs.

from ptyprocess.

kolyshkin avatar kolyshkin commented on August 22, 2024

@takluyver well, perhaps you can do something like this instead: python/cpython@5626fff

The good news is:

  1. it's already written, just need to be adopted to your codebase;
  2. it's a small change, relatively easy to review;
  3. this is Linux-only and won't break any other platform;
  4. it falls back to the existing implementation in case it's not working;
  5. it will speed up your software considerably under Docker on Linux.

from ptyprocess.

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.