PEP 324 error

Andrew alif016 at gmail.com
Tue Nov 18 22:26:21 EST 2008


It appears PEP 324 is missing the part about check_call():

http://www.python.org/dev/peps/pep-0324/
...

This module also defines two shortcut functions:

    - call(*args, **kwargs):
          Run command with arguments.  Wait for command to complete,
          then return the returncode attribute.

          The arguments are the same as for the Popen constructor.
          Example:

          retcode = call(["ls", "-l"])

    Exceptions
    ----------
    ...


Note the lack of "two shortcut functions".

In the docstring of subprocess in python 2.5:

This module also defines two shortcut functions:

call(*popenargs, **kwargs):
    Run command with arguments.  Wait for command to complete, then
    return the returncode attribute.

    The arguments are the same as for the Popen constructor.  Example:

    retcode = call(["ls", "-l"])

check_call(*popenargs, **kwargs):
    Run command with arguments.  Wait for command to complete.  If the
    exit code was zero then return, otherwise raise
    CalledProcessError.  The CalledProcessError object will have the
    return code in the returncode attribute.

    The arguments are the same as for the Popen constructor.  Example:

    check_call(["ls", "-l"])

I don't know if check_call is going to be deprecated, but there still appears to be a missing function.
I'm not sure if this is the correct way to report errors, but I think it's prudent to keep the documentation comprehensive.
--
Andrew





More information about the Python-list mailing list