Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Handle TrashPermissionError, now that it exists#5894

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
kevin-bates merged 2 commits intojupyter:masterfromstefanor:trashpermissionerror
Jan 3, 2021

Conversation

@stefanor
Copy link
Contributor

@stefanorstefanor commentedDec 1, 2020
edited
Loading

In Ubuntu's automated test environmentfull log example, both HOME and the temporary directories are likely to be on a tmpfs. That will cause
gi.repository.GLib.GError: g-io-error-quark: Trashing on system internal mounts is not supported (15) which will raise aTrashPermissionError.

As the comments in the code indicate,_check_trash() was added (in#3304) becauseTrashPermissionError didn't
exist, yet. We asked send2trash to implement such an exception, so that we wouldn't have to guess whether a file was trash-able or not, and they did. So, let's take advantage of it.

Because we don't permanently delete, recursively,test_delete_non_empty_dir will now fail in environments where the test data isn't trash-able. So, handle that, and skip the test gracefully.

Closes:#3374

_check_trash() was added (injupyter#3304) because TrashPermissionError didn'texist, yet.Now that it does, we can use it, and stop guessing what will cause apermission problem.Closes:jupyter#3374
If the test working directory isn't trashable, we expect to not be ableto delete the non-empty directory.
@stefanorstefanor changed the titleHandle TrashPermissionError now that it existsHandle TrashPermissionError, now that it existsDec 1, 2020
Copy link
Member

@kevin-bateskevin-bates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nice cleanup - thank you.

@kevin-bateskevin-bates merged commit1672777 intojupyter:masterJan 3, 2021
@stefanorstefanor deleted the trashpermissionerror branchJanuary 6, 2021 01:21
@blink1073blink1073 added this to the6.2 milestoneMar 18, 2021
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsSep 15, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

1 more reviewer

@kevin-bateskevin-bateskevin-bates approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

6.2

Development

Successfully merging this pull request may close these issues.

send2trash.exceptions.TrashPermissionError

3 participants

@stefanor@kevin-bates@blink1073

[8]ページ先頭

©2009-2025 Movatter.jp