You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bbmmymannequin opened this issue
Nov 14, 2019
· 3 comments
Labels
3.7 (EOL)end of life3.8only security fixes3.9only security fixesdocsDocumentation in the Doc dirstdlibPython modules in the Lib dirtype-featureA feature request or enhancement
For versions 2.7 through 3.9 of https://docs.python.org/3/library/os.html, os.WNOHANG is described as returning (0, 0) when no child process status is immediately available.
However, both os.wait3() and os.wait4() return 3-element tuples and are described as being similar to os.waitpid(). This, combined with the os.WNOHANG documentation being somewhat open to interpretation, makes it very easy to conclude (incorrectly) that wait3(WNOHANG) and wait4(WNOHANG) would return (0, 0) when no child process status is immediately available. In fact, they would return a 3-element tuple with the first 2 elements being 0.
I suggest rephrasing the os.WNOHANG documentation to the following (or something similar):
"The option for waitpid() to return immediately if no child process status is available immediately, in which case the function returns (0, 0). Correspondingly, wait3() and wait4() would return 3-element tuples with the first 2 elements being 0 and the last being a default-constructed resource usage information object."
If this documentation fix will not be backported (i.e. it will only apply to versions *after* the aforementioned bug fix) then a more precise way to phrase that last part would be:
"...with the first 2 elements being 0 and the last being an all-zero resource usage information object."
3.7 (EOL)end of life3.8only security fixes3.9only security fixesdocsDocumentation in the Doc dirstdlibPython modules in the Lib dirtype-featureA feature request or enhancement
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: