-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Ensure jupyter config dir exist #5078
Conversation
The bug: When - the user login for the first file with a token and want to change his/her password - and if the folder `~/.jupyter` (`jupyter_config_dir()`) does not exist then the jupyter server will raise a `FileNotFoundError` exception and return a 500 error. This change tries to fix this bug by ensure the folder exist so that the `config_file` can be opened.
notebook/auth/security.py
Outdated
@@ -118,6 +118,7 @@ def persist_config(config_file=None, mode=0o600): | |||
""" | |||
|
|||
if config_file is None: | |||
os.makedirs(jupyter_config_dir(), exist_ok=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be outside the if
block, and use os.path.dirname()
, so it works the same way if a path is passed in explicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
An alpha release of nbconvert has broken notebook's tests, so we're stalled until someone gets to figuring that out and fixing it (I'm not sure yet if it needs changes in the tests or in nbconvert). Other than that, I think this looks good. |
sure, let's wait for that. |
Close/reopen to rerun tests with master. |
Thanks! |
The bug: when
~/.jupyter
(jupyter_config_dir()
) does not existthen the jupyter server will raise a
FileNotFoundError
exception and return a 500 error.This change tries to fix this bug by ensuring the folder exists so that the
config_file
can be opened.