Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #92529 > unrolled thread
| Started by | random832@fastmail.us |
|---|---|
| First post | 2015-06-12 10:46 -0400 |
| Last post | 2015-06-12 10:46 -0400 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: os.system error returns random832@fastmail.us - 2015-06-12 10:46 -0400
| From | random832@fastmail.us |
|---|---|
| Date | 2015-06-12 10:46 -0400 |
| Subject | Re: os.system error returns |
| Message-ID | <mailman.427.1434120398.13271.python-list@python.org> |
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 top | Article view | comp.lang.python
csiph-web