[Python-Dev] slightly misleading Popen.poll() docs (original) (raw)
Chris Withers chris at simplistix.co.uk
Wed Dec 5 17:08:46 CET 2012
- Previous message: [Python-Dev] cpython: Issue #16455: On FreeBSD and Solaris, if the locale is C, the
- Next message: [Python-Dev] slightly misleading Popen.poll() docs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi All,
Would anyone object to me making a change to the docs for 2.6, 2.7 and 3.x to clarify the following:
http://docs.python.org/3/library/subprocess.html#subprocess.Popen.poll
A couple of my colleagues have ended up writing code like this:
proc = Popen(['some', 'thing']) code = proc.poll() if code: raise Exception('An error happened: %s' % code)
...on the back of the fact that if your process terminates really quickly, and the docs say that the returncode is set by poll() (sigh).
I'd like to change the docs for poll() to say:
""" Check if child process has terminated. If it has, the returncode attribute will be set and that value will be returned. If it has not, None will be returned and the returncode attribute will remain None. """
Any objections?
Chris
-- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk
- Previous message: [Python-Dev] cpython: Issue #16455: On FreeBSD and Solaris, if the locale is C, the
- Next message: [Python-Dev] slightly misleading Popen.poll() docs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]