-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
preferred_dir bug #806
Comments
While using previously the preferred_dir feature, I have always provided both values and it was working fine.
If I only provide preferred_dir with ...
.... it fails with So if no root_dir is provided, the current directory (cwd) is considered the root_directory, which is I guess the expected behavior. If I start with
the server start fine and jupyter lab shows the home icon (preferred location) as expected. |
I was just about to say that I'm also unable to reproduce this issue, then saw the backticks in Marc's example for the
so, what the heck, I've heard of more bizarre stuff before, and modified my config to use the backticks. Sure enough, this appears to side-affect the calculation of (Note that the Assuming this is the common link, this feels more like an issue in |
Heh, the backticks were a mistake on my part, not intentionally part of the bug reoirt. I actually am using |
Hmm. Then I guess I can't reproduce your issue when setting the config file entry to:
In that case, the configured I think there should be some other reproductions before transferring elsewhere and, if it only amounts to backticks being the issue, I believe there could be justification for push back since they're really not valid string specifiers. |
Also, I'm wondering if there needs to be some further clarification. How are you determining that root-dir is getting changed/reverted? Is it based on the directory produced from within a running kernel? Or by virtue of what directories can be navigated via the file browser (left-hand) pane? (I'm using the latter of these.) I still feel like we're missing some information here if you're able to reproduce this. |
I am able to reproduce this on multiple operating systems using the directions above. There is no need to put
https://github.com/jupyter-server/jupyter_server/pull/805/files adds this in the output (which is why I install from 1.x). |
Thanks for the latest information Marc - that is helpful. Looking back on things, I definitely got confused because this is reproducible and I probably had
|
Sorry my initial example was confusing, I should have started with my second one to keep it simpler. Glad others can reproduce this now - that table is interesting. Do you think it's a jupyter_server bug or a traitlets bug? |
I can not reproduce on my laptop with 4.0.0a24 nor 3.3.4. The following starts as expected.
Moving the jupyter_server_config.py in the current folder (where I launch jupyter lab) give the same result (starts correctly). |
My last run with jupyterlab 4.0.0a24 has
|
@echarles can you shares your CWD when you run these commands? |
mmh when I run the command from the
So running from anywhere in the defined tree And yes, it breaks if you run from outside of that tree. We have a reproducer. |
I realise this is what @kevin-bates has shown with his table.
Prolly a jupyter_server bug. I will look into that. |
My IDE is not cooperating but, from what I can determine, this is probably an issue with the order traits are validated. My guess is that the default values are gathered (so It might be a tough row to hoe to get changes in |
This turned out to be a bit of a rat's nest for such an edge case but will submit a PR shortly. |
Thanks @kevin-bates! |
Thx a lot @kevin-bates for the fix and associated tests. I have tested latest main and I confirm the issue is solved. The backport PR to |
Description
I'm not sure if this repo is the root cause of this bug, but setting
--ServerApp.preferred_dir
on the CLI overridesroot_dir
as well.Example:
Reproduce
Example (assume cwd
/path/to/cwd
)This errors (correctly) because
/path/to/preferred
is not a subdir of/path/to/cwd
.Now edit a config, such as
~/.jupyter/jupyter_server_config.py
and put in:This works:
This does not as root-dir is overridden back to
/path/to/cwd
Expected behavior
Setting preferred_dir does not change root-dir.
Context
[email protected]
[email protected]
The text was updated successfully, but these errors were encountered: