Giter Site home page Giter Site logo

Integrate subprocess32 about tauthon HOT 11 OPEN

naftaliharris avatar naftaliharris commented on August 13, 2024 1
Integrate subprocess32

from tauthon.

Comments (11)

naftaliharris avatar naftaliharris commented on August 13, 2024

Hmm, shouldn't be too bad probably.

A quick look at the 3.5.2 version of subprocess shows that it requires time.monotonic, which I've been meaning to do as it's a dependency for some of the async-type stuff. But maybe makes sense to do 3.2 version of subprocess first as it's already done...

from tauthon.

kovidgoyal avatar kovidgoyal commented on August 13, 2024

See https://github.com/kovidgoyal/calibre/blob/master/src/calibre/utils/monotonic.c for monotonic for python 2

from tauthon.

dan-stromberg avatar dan-stromberg commented on August 13, 2024

I submitted a pull request to the subprocess32 project to make subprocess32 build on tauthon. Someone e-mailed me back indicating it'd be better to merge subprocess32 into tauthon than to patch subprocess32 to work out of the box on tauthon.

from tauthon.

arizvisa avatar arizvisa commented on August 13, 2024

@dan-stromberg, what's the PR# (or your branch) that you submitted to subprocess32?

from tauthon.

dan-stromberg avatar dan-stromberg commented on August 13, 2024

from tauthon.

arizvisa avatar arizvisa commented on August 13, 2024

thx, sir.

I'm working on time.monotonic* right now. I'll look at how to include your PR afterwards.

from tauthon.

dan-stromberg avatar dan-stromberg commented on August 13, 2024

from tauthon.

arizvisa avatar arizvisa commented on August 13, 2024

I just submitted Python3's time.monotonic functions as PR #122 (excluding time.get_clock_info). If something needs that lmk, and I can work on implementing that in the next couple days.

It needs testing for OSX as I don't have access to that platform. Actually it probably needs testing against whatever consumes it as I just wrote it up and submitted the PR a few minutes ago....

from tauthon.

arizvisa avatar arizvisa commented on August 13, 2024

So the internal _subprocess and _posixsubprocess modules can probably be merged so that fork_exec is exposed on both platforms (and backwards compatibility can be maintained). Then anything that depends on these binary modules can just use whatever is necessary.

However, are there any other differences in the subprocess module between Python2 and Python3? If we simply replace Lib/subprocess.py with Python3's version, will that potentially break modules that depend on Python2's implementation? Is this something that we can just get away with, or would it just be safer in terms of compatibility to have it as a separate module similar to subprocess32?

from tauthon.

stefantalpalaru avatar stefantalpalaru commented on August 13, 2024

If we simply replace Lib/subprocess.py with Python3's version, will that potentially break modules that depend on Python2's implementation? Is this something that we can just get away with

No, it isn't. Backwards compatibility is a very high priority for us - comes right after security.

from tauthon.

arizvisa avatar arizvisa commented on August 13, 2024

I suppose it wasn't too clear, but according to https://docs.python.org/3/whatsnew/3.7.html, the differences seem to be that subprocess.run contains a capture_output keyword, an alias for universal_newlines as text, context manager for Popen, better handling of KeyboardInterrupt (by adding a delay), and `close_fds is now defaulted to true.

Other than close_fds, all of these things seem backwards-compatible. Is this all that's different between these interfaces?

Personally instead of using the subprocess interface, I prefer just having access to handles/fds and feeding i/o to coroutines that use yield as an expression, so I'm totally unfamiliar with the differences between both of the subprocess implementations.

from tauthon.

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.