classification
Title: multiprocessing: string arg to SystemExit
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Dan Nawrocki, davin, sbt
Priority: normal Keywords:

Created on 2015-03-13 15:22 by Dan Nawrocki, last changed 2015-03-16 14:09 by Dan Nawrocki. This issue is now closed.

Messages (3)
msg238034 - (view) Author: Dan Nawrocki (Dan Nawrocki) Date: 2015-03-13 15:22
It seems that the fix for 13854 (http://bugs.python.org/issue13854) actually tried to solve 2 issues:

1. handle non-integer, non-string arg to SystemExit
2. use exit code of 0 when the arg was a string

The change involved for #2 seems to go against the documentation for sys.exit:

"...In particular, sys.exit("some error message") is a quick way to exit a program when an error occurs."

Indeed, python 2.7.5 appears to follow this behavior:

[me@localhost ~]$ python -c 'raise SystemExit("bye")'; echo $?
bye
1

Shouldn't the return code from a subprocess when using multiprocessing match the return code when called w/o the multiprocessing module?
msg238054 - (view) Author: Davin Potts (davin) * (Python committer) Date: 2015-03-13 21:21
Are you looking at the current code in the 2.7 branch or just at the code committed in https://hg.python.org/cpython/rev/da5b370f41a1 (done as part of issue13854)?

The code in 2.7 has since been updated and appears to use an exitcode of 1 whenever a str is provided as the arg to SystemExit.

Are you observing something different in practice?
msg238206 - (view) Author: Dan Nawrocki (Dan Nawrocki) Date: 2015-03-16 14:09
I am using 2.7.5 (RHEL7 and FC20). Indeed, this issue appears fixed in 2.7.7, by https://hg.python.org/cpython/diff/44b5ec2f0f5d/Lib/multiprocessing/process.py.

I'm closing as not a bug.

Thanks for the help!
History
Date User Action Args
2015-03-16 14:09:03Dan Nawrockisetstatus: open -> closed
resolution: not a bug
messages: + msg238206
2015-03-13 21:21:04davinsetnosy: + davin
messages: + msg238054
2015-03-13 17:22:27serhiy.storchakasetnosy: + sbt
2015-03-13 15:22:22Dan Nawrockicreate