[Python-Dev] deprecate commands.getstatus()

Titus Brown titus at caltech.edu
Tue Mar 13 23:36:31 CET 2007

On Tue, Mar 13, 2007 at 02:16:21PM -0700, Guido van Rossum wrote:
-> On 3/13/07, Georg Brandl <g.brandl at gmx.net> wrote:
-> > I'd like to deprecate commands.getstatus() in 2.6.
-> >
-> > Reason: there is getoutput() and getstatusoutput(). In the latter, "status"
-> > means the exit code. getstatus(), however, returns the output of "ls -ld
-> > <file>" which is completely nonobvious and confusing.
-> +1.
-> > Perhaps the whole commands module can be deprecated in favor of subprocess.
-> -1.
-> Reason (for both voteS): I have learned that the getoutput() and
-> getstatusoutput() functions in the commands module are exceedingly
-> popular amongst Googlers who write simple Python scripts that
-> occasionally invoke an external command. It's much simpler than using
-> os.popen() or the subprocess module (which is also very popular BTW).

What about reimplementing commands.* using subprocess?  Or providing a
commands.*-compatible interface in the subprocess module?


More information about the Python-Dev mailing list