[Python-Dev] PEP 324: popen5 - New POSIX process module
peter at cendio.se
Wed Jan 7 12:31:59 EST 2004
> > Well, as I described in another mail, it's actually a big advantage to
> > provide both a returncode attribute and an unmodified status value, since
> > it's makes it easy to migrate from the "old" API. Perhaps we'll need to
> > make some changes to the poll() method wrt Windows, though.
> The peculiar "combined" nature of a Unix status value has no analogue in
> Windows. And in the context of an object with multiple attributes, I don't
> see the need anyway. I'd suggest
> Popen.returncode - Process return code, valid on both Unix and Windows
> Popen.signal - Signal which caused the program to exit, Unix only.
With .returncode being None, if the process died due to a signal? Looks
good to me.
> Code which is meant to be portable (to whatever extent that is possible) can
> use returncode without any problems. Code which is Unix-specific can worry
> about signal. (I'd suggest signal=0 means no signal occurred, and on Windows,
> signal is always 0. This means that it's still possible to write portable code
> which tests signal.)
Why not signal=None, if no signal occured?
More information about the Python-Dev