Comments (1)
You're patching in the wrong order. Do this:
from gevent import monkey; monkey.patch_all()
from subprocess import Popen
Popen(['echo', 'ok'])
(I'm using patch_all()
because that's the recommended way to patch; patching only some modules is advanced usage and isn't guaranteed to work because of interactions between modules.)
gevent's patching replaces the entire subprocess.Popen
object, but if you've already imported it by name, you have your own private reference to the old stdlib Popen
object, which cannot work.
This also works (it should be clear from the above why it works), but this is not recommended --- you should instead patch as early as possible.
from gevent import monkey
import subprocess
monkey.patch_all()
subprocess.Popen(['echo', 'ok'])
from gevent.
Related Issues (20)
- ssl.SSLError: [SSL: BAD_LENGTH] bad length (_ssl.c:2423)
- Fail to install v23.9.0 - tries to build from source instead of pre-compiled wheel HOT 6
- Missing manylinux2014 wheels for py3.8/py3.9? HOT 3
- 23.9.1: env name py311-cffi conflicting with base python python2.7 HOT 1
- No wheels for new version on python 3.10 docker image HOT 1
- gevent.pywsgi fails to inform which random port it uses when given port 0
- AbstractLinkable._notify_links under VS Code debugger HOT 2
- Wheels for Python 3.9 - ARM64 missing for new releases HOT 2
- this product dont works with flask 3.0 greenlet 3.0 on python 3.12 HOT 1
- How to disable verbose output of the monitoring thread? HOT 1
- client hang with gevent time out HOT 1
- gevent.exceptions.InvalidSwitchError: Invalid switch into AsyncResult.wait(): None HOT 1
- gevent.timeout.Timeout: 0.0 seconds HOT 3
- Assertion failure in _sempahore.py
- AttributeError: module 'select' has no attribute 'epoll' HOT 2
- TypeError: memoryview: a bytes-like object is required, not 'str' HOT 1
- gevent.hub.LoopExit: This operation would block forever HOT 3
- Bad use of gevent: the Thread has created before patch_all, is_alive() always True HOT 3
- Test units with 0 ran tests (skipped) exit with code 5 on Python 3.12 HOT 7
- Logging lock not released when held by OS threads HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gevent.