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

Pass kernel environment to cwd_for_path method #1046

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions jupyter_server/services/kernels/kernelmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def _handle_kernel_died(self, kernel_id):
self.log.warning("Kernel %s died, removing from map.", kernel_id)
self.remove_kernel(kernel_id)

def cwd_for_path(self, path):
def cwd_for_path(self, path, **kwargs):
"""Turn API path into absolute OS path."""
os_path = to_os_path(path, self.root_dir)
# in the case of documents and kernels not being on the same filesystem,
Expand Down Expand Up @@ -212,7 +212,7 @@ async def _async_start_kernel(self, kernel_id=None, path=None, **kwargs):
"""
if kernel_id is None or kernel_id not in self:
if path is not None:
kwargs["cwd"] = self.cwd_for_path(path)
kwargs["cwd"] = self.cwd_for_path(path, env=kwargs.get("env", {}))
if kernel_id is not None:
kwargs["kernel_id"] = kernel_id
kernel_id = await self.pinned_superclass._async_start_kernel(self, **kwargs)
Expand Down