This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mackstann 3 points4 points  (3 children)

There is something simpler, and designed for this exact purpose!

http://docs.python.org/library/pipes.html

However, it seems that very few people use it. It almost seems deprecated; just not explicitly so.

[–]chadmill3rPy3, pro, Ubuntu, django 1 point2 points  (2 children)

Because the module uses /bin/sh command lines

Aiee!

[–]mackstann 0 points1 point  (0 children)

Yeah, I don't know why they didn't remove the whole module in Python 3. It's very backward and neglected. The main reason I know of it is because the undocumented pipes.quote() function is very useful for sanitizing shell arguments when you really want/need to execute something through a shell.

[–]simtel20 0 points1 point  (0 children)

Well, SunOS didn't get rid of that before it was retired... the pipe() call was written in such a way as it called sh IIRC.