Skip to content

Commit 27c30ad

Browse files
Pass kernel environment to cwd_for_path method (#1046)
Co-authored-by: Steven Silvester <[email protected]>
1 parent 213e25c commit 27c30ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jupyter_server/services/kernels/kernelmanager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def _handle_kernel_died(self, kernel_id):
180180
self.log.warning("Kernel %s died, removing from map.", kernel_id)
181181
self.remove_kernel(kernel_id)
182182

183-
def cwd_for_path(self, path):
183+
def cwd_for_path(self, path, **kwargs):
184184
"""Turn API path into absolute OS path."""
185185
os_path = to_os_path(path, self.root_dir)
186186
# in the case of documents and kernels not being on the same filesystem,
@@ -212,7 +212,7 @@ async def _async_start_kernel(self, kernel_id=None, path=None, **kwargs):
212212
"""
213213
if kernel_id is None or kernel_id not in self:
214214
if path is not None:
215-
kwargs["cwd"] = self.cwd_for_path(path)
215+
kwargs["cwd"] = self.cwd_for_path(path, env=kwargs.get("env", {}))
216216
if kernel_id is not None:
217217
kwargs["kernel_id"] = kernel_id
218218
kernel_id = await self.pinned_superclass._async_start_kernel(self, **kwargs)

0 commit comments

Comments
 (0)