Skip to content
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

Unable to delete nonempty folders #998

Closed
mowilk opened this issue Sep 9, 2019 · 2 comments
Closed

Unable to delete nonempty folders #998

mowilk opened this issue Sep 9, 2019 · 2 comments

Comments

@mowilk
Copy link

mowilk commented Sep 9, 2019

Not sure if this is intended or not, but trying to delete a nonempty folder using the graphic file browser prompts the message: "A directory must be empty before being deleted." Using rm -rf in terminal works fine.

@yuvipanda
Copy link
Contributor

Thanks for opening this, @mowilk.

From jupyter/notebook#2760 and issues linked from there, if send2trash is not installed, you can't delete non-empty folders. send2trash sends stuff to the 'Recycle Bin' equivalent. Since we don't have that in JupyterHub, it's disabled to prevent people from accidentally deleting entire directories with no way to recover them. This seems like a reasonable tradeoff to me, so I'd say it is intended?

JupyterLab might have a way to delete recursively in the UI, but in the meantime I'd recommend using rm -rf if you have to.

Hope this helps!

@Dmitry1987
Copy link

@yuvipanda isn't it only relevant for Notebook, and not jupyterhub? (hub just spawns a notebook?)
an ugly hack is to patch a file that's responsible for send2trash, jupyter/notebook#4916 i have no idea how to do it otherwise.

But what do you mean it's disabled in jupyterhub? like, if I include this package in hub server, it can be enabled in all notebooks and will work or something? :O I don't think the hub is one that runs the delete operation in any case, it can only affect the settings of spawned Notebooks, unless they're overridden with custom config (which I did, and enabled the send2trash, then disabled, nothing works)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants