Skip to content
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 non-zero when ipython is given a file path to run that doesn't exist #12074

merged 1 commit into from
Jan 9, 2020


Copy link

@jpotter jpotter commented Jan 4, 2020

Simple PR to update the exit code for ipython when given a file that doesn't exist from 0 ("success") to 2 (matches python's behavior for this condition).

Currently, running ipython with a file argument that does not exist causes a zero exit code. This can cause problems in automation, i.e. bash scripts that have -e set and have an invalid file path.

$ ./venv/bin/ipython
[TerminalIPythonApp] WARNING | File not found: ''
$ echo $?

This PR changes the behavior to:

$ ./venv/bin/ipython
[TerminalIPythonApp] WARNING | File '' doesn't exist
$ echo $?

Copy link

Carreau commented Jan 9, 2020

Thanks, that seem reasonable,

@Carreau Carreau merged commit c72cb7c into ipython:master Jan 9, 2020
@Carreau Carreau added this to the 7.12 milestone Feb 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants