Message241954
| Author |
belopolsky |
| Recipients |
belopolsky, skrah |
| Date |
2015年04月24日.16:43:21 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1429893801.78.0.347031200987.issue24052@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> The value of exit returned to the parent should be status & 0377.
Apparently, this is not so on Windows. See msg241903 in #24045.
POSIX defines [1] exit to return status & 0377, but that does not mean that sys.exit(256) must return 0 without a warning. It is very unlikely that someone would intentionally use code=256 to signify success. It is much more likely that sys.exit(256) is a result of a programming error.
I believe a better behavior for sys.exit() would be to truncate the code values to 8-bit range so that non-zero status would always be returned as non-zero, but possibly different value.
[1] http://pubs.opengroup.org/onlinepubs/009695399/functions/exit.html |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2015年04月24日 16:43:21 | belopolsky | set | recipients:
+ belopolsky, skrah |
| 2015年04月24日 16:43:21 | belopolsky | set | messageid: <1429893801.78.0.347031200987.issue24052@psf.upfronthosting.co.za> |
| 2015年04月24日 16:43:21 | belopolsky | link | issue24052 messages |
| 2015年04月24日 16:43:21 | belopolsky | create |
|