Message387740
It's still the case in 3.10 that unsigned status codes are limited to 0x7FFF_FFFF, and any larger value gets mapped to -1 (0xFFFF_FFFF). For example:
>>> rc = subprocess.call([sys.executable, '-c', 'raise SystemExit(0x7FFF_FFFF)'])
>>> hex(rc)
'0x7fffffff'
>>> rc = subprocess.call([sys.executable, '-c', 'raise SystemExit(0x8000_0000)'])
>>> hex(rc)
'0xffffffff'
>>> rc = subprocess.call([sys.executable, '-c', 'raise SystemExit(0xC000_0005)'])
>>> hex(rc)
'0xffffffff'
WinAPI ExitProcess() and GetExitCodeProcess() use unsigned values. The latter is called by subprocess.Popen.wait(). In practice, this return code, which may be larger than 0x7FFF_FFFF, might get passed to SystemExit() or os._exit(). |
|
Date |
User |
Action |
Args |
2021-02-26 19:37:05 | eryksun | set | recipients:
+ eryksun, Arfrever, docs@python, martin.panter |
2021-02-26 19:37:05 | eryksun | set | messageid: <1614368225.47.0.915107209673.issue24045@roundup.psfhosted.org> |
2021-02-26 19:37:05 | eryksun | link | issue24045 messages |
2021-02-26 19:37:05 | eryksun | create | |
|