[issue45554] multiprocessing exitcode is insufficiently documented

2021-12-16 Thread John Marshall


Change by John Marshall :


--
keywords: +patch
pull_requests: +28360
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30142

___
Python tracker 
<https://bugs.python.org/issue45554>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45554] multiprocessing exitcode is insufficiently documented

2022-01-18 Thread John Marshall


John Marshall  added the comment:

Ping -- This issue has an associated PR that expands the 
multiprocessing.Process.exitcode documentation to cover normal, sys.exit(), and 
exception-raised termination of the child process.

https://github.com/python/cpython/pull/30142

The PR has been available for a month but has not received any review comments.

--

___
Python tracker 
<https://bugs.python.org/issue45554>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45554] multiprocessing exitcode is insufficiently documented

2021-10-21 Thread John Marshall

New submission from John Marshall :

<https://docs.python.org/3.11/library/multiprocessing.html#multiprocessing.Process.exitcode>
 describes exitcode as

"The child’s exit code. This will be None if the process has not yet 
terminated. A negative value -N indicates that the child was terminated by 
signal N."

and similarly in earlier documentation versions.

This does not describe what the exit code will be under normal circumstances, 
or if the child abends by raising a Python exception.

By examination of BaseProcess._bootstrap() it can be determined that the 
current behaviour appears to be:

* even if your subclass overrides the run() method, whatever this method 
returns is ignored (and in particular the return value has no effect on the 
child's exit code);

* if the run() method returns normally, the child's exit code will be 0;

* if the run() method raises SystemExit (or, I guess, calls sys.exit()) with an 
integer exit status, that exit status will be propagated to the child's exit 
code;

* if the run() method raises any other exception, the exception traceback will 
be printed to stderr and the child's exit code will be 1.


However I did not see a way to figure these details out from the documentation, 
and it is unclear whether all these details are supported behaviours.

--
assignee: docs@python
components: Documentation
messages: 404597
nosy: docs@python, jmarshall
priority: normal
severity: normal
status: open
title: multiprocessing exitcode is insufficiently documented
type: behavior

___
Python tracker 
<https://bugs.python.org/issue45554>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com