jupyter_server
jupyter_server copied to clipboard
Some systems can grant access to a file without granting access to the surrounding directory.
Problem
On some operating systems (mainly iOS, but probably Android and other OS too), you can have read-write access to a file without having access to the surrounding directory. When that happens, jupyter_server will encounter issues at three points:
- for
atomic_writing(inservices/contents/fileio.py) where, to save a file, it creates a new file next to it then copies it over. - for file checkpoints (in
services/contents/filecheckpoints.py), where it creates a checkpoint file in the local directory. - when starting the kernel (in
services/kernels/kernelmanager.py), where it tries to change the working directory to the directory surrounding the notebook.
These are all minor issues, and they are easy to workaround (for atomic_writing, the workaround is simple_writing, which is already present in fileio.py).
Proposed Solution
Check that there is write and execution permission on a directory before attempting an operation on that directory, and have a backup directory or backup operation if permission is denied. I can submit a PR, but I'm not sure if you would be interested, given that it's an issue that only affects few OS.
Additional context
I wonder if this would also solve some issues seen when using other non-posix filesystems, such as FUSE-based mounts? In this case it'd need to be a configurable option since the directory will still be writeable.