Skip to content

Fix: normalize kernel path with forward slashes (Windows) - #3023

Merged
agoose77 merged 1 commit into
jupyter-book:mainfrom
TimMonko:fix/windows-kernel-loc
Aug 8, 2026
Merged

Fix: normalize kernel path with forward slashes (Windows)#3023
agoose77 merged 1 commit into
jupyter-book:mainfrom
TimMonko:fix/windows-kernel-loc

Conversation

@TimMonko

@TimMonko TimMonko commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

References and Relevant Issues

Closes #3010

Description

When executing notebooks on Windows, the kernel starts from the root rather than the notebook's directory. On Unix systems, the kernel starts from the notebook's directory. This is because path.relative returns native separators (backslashes on Windows), and Jupyter Server API paths are /-delimited. With a Windows path, Jupyter Server silently falls back to the server root.

Jupyter server docs explaining the path resolution
And I think this is the actual juypter-server forward-slash code being executed by myst-execute.

I made https://github.com/TimMonko/myst-cwd-repro to demonstrate the issue -- and building with bun (my first time) and running this repo works with the fix.

I'm not sure if I can demonstrate this with a regression test because CI is only Linux it appears, so I guess you could mock the Windows path? Anyways, it's why I left a thorough comment in the code.

I used Deepseek to help me navigate mystmd. To be honest, I've never looked at typescript in my life so please be honest with me.

@changeset-bot

changeset-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2b35442

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@choldgraf choldgraf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like a safe change to me, thanks for the comments and keeping this tightly focused

@agoose77

agoose77 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Excellent — good spot that the paths are unix-like, not platform-specific!

@agoose77
agoose77 merged commit 1a1e16b into jupyter-book:main Aug 8, 2026
9 checks passed
@github-project-automation github-project-automation Bot moved this from Ready for review to Done in Jupyter Book and MyST Team Priorities Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Development

Successfully merging this pull request may close these issues.

Windows: Build executes notebooks from the root rather than notebook location

3 participants