notebook
notebook copied to clipboard
Bug when renaming file (notebook 6.4.12)
Describe the bug In notebook 6.4.12,we cannot rename file sometimes.
To Reproduce Steps to reproduce the behavior:
- Install notebook 6.4.12
- Start notebook with
root_dir="/home/foobar"
- Create a directory named
abc
(or any name with lengthlen(root_dir) - len("Untitled") - 1
) - Create a notebook with default filename 'Untitled.ipynb'
- Rename the notebook to any other filename
Then you should got the error message
File "/home/xxxxxxx/.miniconda3/lib/python3.8/site-packages/notebook/services/contents/filemanager.py",
line 579, in rename_file raise web.HTTPError(400, f'Cannot rename hidden file or directory {os_path!r}')
NameError: name 'os_path' is not defined
Expected behavior
Rename the file successfully.
According to the error message, I found a typo here (os_path
is not defined, it should be old_path
). .https://github.com/jupyter/notebook/blob/3e5b767ddbc3526729cadbc69fe472ffc3ec2e7e/notebook/services/contents/filemanager.py#L578-L579 And I notice that the result of is_hidden(old_path, self.root_dir)
is true, this is because the result of "abc/Untitled.ipynb"[len("/home/foobar"):]
is .ipynb
and it is treated as a hidden file.
It seems that this bug is introduced by this commit https://github.com/jupyter/notebook/commit/f69eb96cff7149b38bca068f4b7faaa7baf55902 .
I faced this same error too. Can someone fix this?
I faced this same error too. Can someone fix this?
Me too!
Same error. I have to rename it in the file folder after I close the jupyter notebook.
The same.
Please resolve the bug
Hi, After I rename it, it will be fine. I continue to check the information. It may have the same name as a file in the system
Message ID: @.***>
I faced this same error too.
i get the same error
Just rename it offline and reload the page. It should work
notebook/services/contents/filemanager.py
There is an error on this file rename function (line 500+)
The only way how to solve this situation is to downgrade...
pip3 install --upgrade notebook=="6.4.11"
notebook/services/contents/filemanager.py
There is an error on this file rename function (line 500+)
The only way how to solve this situation is to downgrade...
pip3 install --upgrade notebook=="6.4.11"
thanks it helps
This problem also exists in version 6.5.2
@zyzand The latest release of Notebook, 6.5.3 should include the fix by @yacchin1205. Would you be able to upgrade to 6.5.3 and see if you still experience this issue?
It works after I upgrade to version 6.5.3. Thanks.
@zyzand The latest release of Notebook, 6.5.3 should include the fix by @yacchin1205. Would you be able to upgrade to 6.5.3 and see if you still experience this issue?
Thank you @zyzand! As there has been a release with a fix for this issue, I will go ahead and close it.