-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Read-only notebooks can't be unlocked for editing #8323
Comments
I think you will need to reload the page. |
We discussed that already in person I dont' remember all the details, but propagating the change of the on-disk file is problematic in a few ways. 1) you have to watch the files regularly. 2) lots of logics are not triggered/deactivated when the file is RO (autosave is one of them). 3) if we support making file writable again, then we need to support setting the file a RO while the notebook is loaded. Checking only at save, also mean we dont' get early warning as current UI does. So maybe we should make it more visible when you start modifying things, that the notebook is RO. |
You are aleady doing a pretty good job at making it visible. It's quite nice. The problem is that people intuitively assume that the read-only state is reversible and start editing anyway. I think the ideal solution would be to keep the existing implementation, but also re-check permissions on any manual attempt to save (clicking the save button or hitting ctrl-s). Another good alternative would be to offer a Save As functionality, so users would have a chance to save their work and manually overwrite the locked file later. |
The "Save As" option is weird because you are backed by a kernels, and what do you do ? Create a new kernel ? You can't have 2 notebooks attached to the same kernel. There is a make a copy, but make a copy also rely on having disk access... It's internally more complex than it looks, but we'll try to do better. |
Yeah, I presume you could create a brand new notebook with a different name? Exactly what "Make a copy" does, except that all changes are lost in the current implementation. |
It would be great to have a fix for this. I run into this issue quite often when I work with notebooks in a source control system that locks your local files that that aren't checked out (for example, Perforce). Sample use case:
|
Actually the current early warning is too subtle given that users may lose work and will certainly be concerned - it's quite easy for someone to start editing without realizing that the backing file is readonly. A modal dialog (or something else requiring agreement) once a user tries to edit would be better. |
An alternative to begin able to make changes and adding a Save As feature, would be to not allow changes to a read-only file. Only allow cell execution. |
Discussion continues on jupyter/notebook#1324 - thanks @PrinterOperator for resurrecting it. |
The problem with the "make a copy" workaround is that it copies the notebook on disk not the one in memory. So any changes that have been made will be lost. |
Wow, I just lost half an hour's work due to this! I didn't notice it was read-only, and "Make a Copy" didn't work "Save and checkpoint" was disabled because it was read-only, and there is no "Save as..." feature. This is really not user-friendly! |
Wow I just lost six hours' work. Never noticed the tiny little icon indicating RO and save is locked - I even told it to save a couple of times and didn't notice the other tiny little icon complaining it was RO status. I am more than a little miffed. Surely the notebook could provide better notice of RO status. |
After being burned by this many times I discovered this workaround hack from this thread: jupyter/notebook#1324 (comment)
It saved my file! For once I didn't lose content! This is an ugly hack, but its better than the alternative. |
I found an easy workaround:
This seems to be copying even cell outputs. |
For me, chmod 777 <notebook_directory> on linux solve the issue. |
Read-only notebook files remain read-only even if the read-only file system flag is cleared. Restarting the kernel doesn't help. The only option at the moment is to close the notebook and open it again, potentially losing all changes. Maybe IPython could check if the current notebook is read-only every time the save button is pressed, rather than only once immediately after loading the file?
Steps to reproduce:
Tested on windows with IPython 3.0.0. I think this problem didn't exist in earlier versions.
The text was updated successfully, but these errors were encountered: