non-blocking subprocess module

118 views
Skip to first unread message

Mark Visser

unread,
Jul 5, 2010, 10:07:35 AM7/5/10
to gev...@googlegroups.com
Hello,

I'm evaluating gevent for use in a project. This project has a heavy dependency on I/O to external processes, so as part of my evaluation I implemented Python's subprocess module using non-blocking I/O. I've attached the module and unit tests here. I've only tested this on Linux. Feedback is appreciated!

cheers,
-Mark
subprocess.py
test__subprocess.py

Denis Bilenko

unread,
Jul 8, 2010, 3:21:58 AM7/8/10
to gev...@googlegroups.com
Hi Mark,

Thank you for sharing!

How well does it match the standard subprocess interface?
Have you tried testing it with the test/test_subprocess.py from the
Python's stdlib?

The code looks good. I've not run it yet though.

One thing to consider is that maybe it's possible to abstract
non-blocking files away?
Attached is such file object that I use for some projects.

Thanks,
Denis.

geventpopen.py

Mark Visser

unread,
Jul 8, 2010, 1:35:23 PM7/8/10
to gev...@googlegroups.com
Hi David,

It matches the stdlib's subprocess module exactly. I'll try the stdlib's tests as soon as I have a spare moment.

cheers,
-Mark
Reply all
Reply to author
Forward
0 new messages