Skip to content

Commit

Permalink
Merge pull request #408 from minrk/close-fds-windows
Browse files Browse the repository at this point in the history
set close_fds=False when starting kernels on Windows
  • Loading branch information
minrk authored Dec 1, 2018
2 parents 50ddc22 + 7a46b6b commit 1d807c2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion jupyter_client/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ def launch_kernel(cmd, stdin=None, stdout=None, stderr=None, env=None,
except:
from _subprocess import DuplicateHandle, GetCurrentProcess, \
DUPLICATE_SAME_ACCESS, CREATE_NEW_PROCESS_GROUP
# Launch the kernel process

# create a handle on the parent to be inherited
if independent:
kwargs['creationflags'] = CREATE_NEW_PROCESS_GROUP
else:
Expand All @@ -115,6 +116,11 @@ def launch_kernel(cmd, stdin=None, stdout=None, stderr=None, env=None,
if redirect_out:
kwargs['creationflags'] = kwargs.setdefault('creationflags', 0) | 0x08000000 # CREATE_NO_WINDOW

# Avoid closing the above parent and interrupt handles.
# close_fds is True by default on Python >=3.7
# or when no stream is captured on Python <3.7
# (we always capture stdin, so this is already False by default on <3.7)
kwargs['close_fds'] = False
else:
# Create a new session.
# This makes it easier to interrupt the kernel,
Expand Down

0 comments on commit 1d807c2

Please sign in to comment.