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

don't use exec on Windows #54

Merged
merged 2 commits into from Sep 16, 2015
Merged

don't use exec on Windows #54

merged 2 commits into from Sep 16, 2015

Conversation

minrk
Copy link
Member

@minrk minrk commented Sep 12, 2015

Use regular Popen instead.

Windows doesn't actually allow process replacement a la unix exec, but Python provides os.exec on Windows even though it doesn't actually work. It doesn't exec, it does fork & exec, which means the parent process returns immediately, and the 'true' process is put in the background.

The alternative is to use execfile on Windows, which would behave the same as exec on *ix, with one exception: it forces all jupyter commands to be run with the same interpreter, rather than respecting shebang lines.

closes jupyter/nbconvert#103

it doesn't exec, it does fork & exec,
which means the parent process returns immediately,
and the 'true' process is put in the background.

Windows doesn't actually allow process replacement.
set handler after spawning subprocess
so it is still forwarded.
@minrk minrk added this to the 4.1 milestone Sep 14, 2015
@minrk
Copy link
Member Author

minrk commented Sep 14, 2015

Confirmed working on Windows.

@sccolbert
Copy link

@minrk
Copy link
Member Author

minrk commented Sep 16, 2015

Thanks, @sccolbert!

@minrk minrk changed the title don't use execvp on Windows don't use exec on Windows Sep 16, 2015
minrk added a commit that referenced this pull request Sep 16, 2015
@minrk minrk merged commit 85a5a46 into jupyter:master Sep 16, 2015
@minrk minrk deleted the windows-exec-what branch September 16, 2015 13:30
@Carreau
Copy link
Member

Carreau commented Sep 16, 2015

I guess that also fixes jupyter/nbconvert#103 ?

@Carreau
Copy link
Member

Carreau commented Sep 16, 2015

I guess that also fixes jupyter/nbconvert#103 ?

Hah, yes already closed. The page was still opened for me and did not refresh correctly. Thanks.

@jorisvandenbossche
Copy link

This also fixes jupyter console on windows: jupyter/jupyter_console#26 (based on a quick test it seems fixed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Critical Error when converting python notebooks that contain - in the name
4 participants