Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #92529
| From | random832@fastmail.us |
|---|---|
| References | <2ebdfdf225c075b2f5ef350b06bc14f0@myglnc.com> <CALwzidk4RoM0owVcWWYGGVUzsGbYWvGzyLXMh=YixDA+sa1xqQ@mail.gmail.com> <1434119128.1233979.293924985.63E81914@webmail.messagingengine.com> |
| Subject | Re: os.system error returns |
| Date | 2015-06-12 10:46 -0400 |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.427.1434120398.13271.python-list@python.org> (permalink) |
For completeness I will note that Windows is completely different. The plain exit status (1 for typical command failures) appears in the os.system result rather than a wait-encoded value. And, incidentally, an MSVC program which calls abort() will return an exit status of 3. A process that terminates another process with TerminateProcess can set that process's exit status to an arbitrary 32-bit value. The MSVC exit function limits the value to one byte, but the raw ExitProcess system call supports any 32-bit value. And, just for fun, two versions of "cat" on my system (one supplied with Git, and one from gnuwin32) return 0x10200 and 0xC000013A respectively when terminated by Ctrl-C. I think the first is some effort at an alternate encoding that's compatible with plain exit statuses in the low-order byte, and the second is the value of STATUS_CONTROL_C_EXIT (an HRESULT). I found some information on google suggesting that some unix-alike layers use an exit status of 0xC00002NN to represent signals (with, once again, plain exit status being a value of 0x00NN). All of these values are available as the returned value from os.system.
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: os.system error returns random832@fastmail.us - 2015-06-12 10:46 -0400
csiph-web