This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients eryksun, miss-islington, vstinner
Date 2020-04-01.16:15:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> 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.
Date User Action Args
2020-04-01 16:15:29vstinnersetrecipients: + vstinner, eryksun, miss-islington
2020-04-01 16:15:29vstinnersetmessageid: <>
2020-04-01 16:15:29vstinnerlinkissue40094 messages
2020-04-01 16:15:29vstinnercreate