STINNER Victor <vstin...@python.org> added the comment:

Eryk:
> The current waitpid() implementation assumes it's okay to discard the upper 8 
> bits of the exit status, which can lose important information.

That's a bug which is independent of this issue.

> Thus not all abnormal terminations can be identified as such. Also, nothing 
> stops a normal termination via ExitProcess from using an NTSTATUS code.

Ok, so the current os.waitstatus_to_exitcode() design is fine. On Windows, we 
can just consider all exit code as a "normal" process exit code.

And there is no need to modify os.waitpid() to return a negative value for 
values larger than (INT_MAX >> 8). We should "just" fix 
os.waitstatus_to_exitcode() to accept any Python integer and simply compute "x 
>> 8", whereas currently the argument is casted to a C int.

I propose to fix os.waitpid() and os.waitstatus_to_exitcode() for "large" exit 
code on Windows in a second time.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40094>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to