Author vstinner
Recipients eryksun, miss-islington, vstinner
Date 2020-04-01.16:15:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1585757729.08.0.246728816446.issue40094@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-04-01 16:15:29vstinnersetrecipients: + vstinner, eryksun, miss-islington
2020-04-01 16:15:29vstinnersetmessageid: <1585757729.08.0.246728816446.issue40094@roundup.psfhosted.org>
2020-04-01 16:15:29vstinnerlinkissue40094 messages
2020-04-01 16:15:29vstinnercreate