New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_exit_code behaves differently in terminal vs ZMQ frontends #2794
Comments
OS X: In [3]: os.system("true")
Out[3]: 0
In [4]: Popen("true", shell=True).wait()
Out[4]: 0
In [5]: os.system("false")
Out[5]: 256
In [6]: Popen("false", shell=True).wait()
Out[6]: 1
In [7]: os.system("notfound")
sh: notfound: command not found
Out[7]: 32512
In [8]: Popen("notfound", shell=True).wait()
/bin/sh: notfound: command not found
Out[8]: 127 Which suggests what you have described elsewhere - the return of os.system is 256 * returncode |
Merged
minrk
added a commit
that referenced
this issue
Jan 18, 2013
fix `_exit_code` after running system calls Correct the exit code to be a simple value, rather than two or three separate values stuffed into a single integer. Closes #2794
minrk
pushed a commit
to minrk/ipython
that referenced
this issue
Jan 26, 2013
minrk
added a commit
that referenced
this issue
Mar 5, 2013
Correct the exit code to be a simple value, rather than two or three separate values stuffed into a single integer. Closes issue #2794. My reading of the [Windows docs](http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/exit.mspx?mfr=true) is that the test I've added should work on Windows as well.
mattvonrocketstein
pushed a commit
to mattvonrocketstein/ipython
that referenced
this issue
Nov 3, 2014
mattvonrocketstein
pushed a commit
to mattvonrocketstein/ipython
that referenced
this issue
Nov 3, 2014
fix `_exit_code` after running system calls Correct the exit code to be a simple value, rather than two or three separate values stuffed into a single integer. Closes ipython#2794
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The ZMQ frontends (which use pexpect to run
!foo
shell commands) set_exit_code
to the simple exit code of the process.In the terminal, we use
os.system
, which on Unix-y systems returns:N.B. the docs also say:
We should work out which systems this affects (i.e. do BSD & Macs do the same thing?) and do something sensible with the exit code.
The text was updated successfully, but these errors were encountered: