jupyter_server icon indicating copy to clipboard operation
jupyter_server copied to clipboard

Whether the preferred-dir parameter can accept relative paths

Open xuoutput opened this issue 3 years ago • 2 comments

Problem

➜   jupyter --version
Selected Jupyter core packages...
IPython          : 7.30.1
ipykernel        : 5.5.5
ipywidgets       : not installed
jupyter_client   : 7.1.0
jupyter_core     : 4.9.1
jupyter_server   : 1.13.1
jupyterlab       : 3.2.5
nbclient         : 0.5.9
nbconvert        : 6.3.0
nbformat         : 5.1.3
notebook         : 6.4.6
qtconsole        : not installed
traitlets        : 5.1.1

tree /home

/home/
├── other_user
│   └── hi.txt
└── user
    └── getting_started.ipynb

When I do not start jupyterlab in the /home path

jupyter lab --notebook-dir='/home' --preferred-dir='other_user'
# or
jupyter lab --notebook-dir='/home' --preferred-dir='./other_user'

[C 2021-12-22 22:16:22.818 ServerApp] Bad config encountered during initialization: No such preferred dir: ''/other_user''
# or
[C 2021-12-22 22:11:45.671 ServerApp] Bad config encountered during initialization: preferred_dir must be equal or a subdir of root_dir: ''/user''

When I start jupyterlab in the /home path, it is normal

solution

➜   jupyter lab  --notebook-dir='/home' --preferred-dir='/home/other_user'

Proposed Solution

Whether the preferred-dir parameter can accept relative paths

Additional context

xuoutput avatar Dec 23 '21 02:12 xuoutput

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

welcome[bot] avatar Dec 23 '21 02:12 welcome[bot]

Hi @xuoutput I think that this was fixed in https://github.com/jupyterlab/jupyterlab_server/pull/233. You can test it after upgrading to latest jupyterlab_server with pip install -U jupyterlab-server (or conda/mamba equivalent).

krassowski avatar Dec 29 '21 02:12 krassowski