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

Don't trash files on different device to home dir on Linux #3304

Merged
merged 1 commit into from Feb 13, 2018

Conversation

Projects
None yet
4 participants
@takluyver
Copy link
Member

takluyver commented Feb 5, 2018

This is a bit of a crude check, but I imagine that most users will be working either in their home directory, or on the same device, so it's not worth trying to do a more complex check. I'm going to ask for better exceptions from send2trash so we can distinguish these cases from others.

Closes gh-3249

@takluyver

This comment has been minimized.

Copy link
Member Author

takluyver commented Feb 5, 2018

I've asked on send2trash about having a more specific exception type that we could catch: hsoft/send2trash#20

@blink1073
Copy link
Member

blink1073 left a comment

Thanks!

@hsoft hsoft referenced this pull request Feb 6, 2018

Merged

Define TrashPermissionError #21

@minrk minrk merged commit 6ac6f97 into jupyter:master Feb 13, 2018

4 checks passed

codecov/patch 81.81% of diff hit (target 0%)
Details
codecov/project Absolute coverage decreased by -<.01% but relative coverage increased by +3.05% compared to 08a17df
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
# files on the same partition as the home directory.
file_dev = os.stat(os_path).st_dev
home_dev = os.stat(os.path.expanduser('~')).st_dev
return file_dev == home_dev

This comment has been minimized.

@michaelkarlcoleman

michaelkarlcoleman Feb 4, 2019

Unfortunately, this test doesn't do what you'd hope on GPFS (under Linux). If the directories are part of different filesets, you'll still get an EXDEV if you try to rename a file/dir from one to the other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.