Skip to content

Commit

Permalink
Backport-1046: Pass kernel environment to cwd_for_path method (#1046)…
Browse files Browse the repository at this point in the history
… (#1051)

Co-authored-by: Steven Silvester <[email protected]>
  • Loading branch information
divyansshhh and blink1073 authored Nov 7, 2022
1 parent d1c0457 commit da7071a
Showing 1 changed file with 2 additions and 2 deletions.
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 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 ensure_async(self.pinned_superclass.start_kernel(self, **kwargs))
Expand Down

0 comments on commit da7071a

Please sign in to comment.