Eryk Sun <eryk...@gmail.com> added the comment:
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(). ---------- type: -> behavior versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue24045> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com