ANN: Sarge, a library wrapping the subprocess module, has been released.

Vinay Sajip vinay_sajip at
Sun Feb 12 06:31:02 EST 2012

On Feb 12, 9:41 am, Anh Hai Trinh < at> wrote:
> Having written something with similar purpose (, here are my comments:
> * Having command parsed from a string is complicated. Why not just have an OOP API to construct commands?

It's not hard for the user, and less work e.g. when migrating from an
existing Bash script. I may have put in the effort to use a recursive
descent parser under the hood, but why should the user of the library
care? It doesn't make their life harder. And it's not complicated, not
even particularly complex - such parsers are commonplace.

> * Using threads and fork()ing process does not play nice together unless extreme care is taken. Disasters await.

By that token, disasters await if you ever use threads, unless you
know what you're doing (and sometimes even then). Sarge doesn't force
the use of threads with forking - you can do everything synchronously
if you want. The test suite does cover the particular case of thread
+fork. Do you have specific caveats, or is it just a "there be
dragons" sentiment? Sarge is still in alpha status; no doubt bugs will
surface, but unless a real show-stopper occurs, there's not much to be
gained by throwing up our hands.

BTW extproc is nice, but I wanted to push the envelope a little :-)


Vinay Sajip

More information about the Python-list mailing list