jupyter / jupyter/notebook

Contents API sort of works for windows-style C:\ paths

Open
#4,640 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
13.3k
Forks
5.8k
Avg merge
6d 11h
Merged PRs (30d)
7

Description

From https://github.com/jupyterlab/jupyterlab/issues/5051#issuecomment-495388593:

If a notebook server is started in `C:\` on windows, and a contents api request is made to `/api/contents/C%3A%5Ctest.txt`, the server actually finds the file and can return it, but the `name` attribute of the response is the full path `C:\test.txt`, not just the filename `test.txt`.

@ivanov and I discussed this, and we think that the contents api should reject backslash-delimited or absolute paths and return an error in these cases. The assumption in the api is that url-style forward-slash paths relative to the server root are what are specified in a contents api call.

Contributor guide

Open the contributing guide

Research direction

Start with the contents API request handling described in the issue and trace how encoded Windows-style and absolute paths are processed. Confirm that backslash-delimited or absolute paths return an error while relative URL-style paths continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.