Comments (3)
This problem can be reproduced as follows:
$ mkdir test
$ chmod -r test
$ trash-put test
$ trash-empty
Traceback (most recent call last):
File "/usr/bin/trash-empty", line 5, in <module>
sys.exit(main())
File "/usr/lib/python2.7/site-packages/trashcli/cmds.py", line 23, in empty
).run(*sys.argv)
File "/usr/lib/python2.7/site-packages/trashcli/trash.py", line 446, in run
parse(argv)
File "/usr/lib/python2.7/site-packages/trashcli/trash.py", line 315, in __call__
self.default_action()
File "/usr/lib/python2.7/site-packages/trashcli/trash.py", line 466, in _empty_all_trashdirs
self.trashdirs.list_trashdirs()
File "/usr/lib/python2.7/site-packages/trashcli/trash.py", line 388, in list_trashdirs
self.emit_home_trashcan()
File "/usr/lib/python2.7/site-packages/trashcli/trash.py", line 393, in emit_home_trashcan
self.home_trashcan.path_to(return_result_with_volume)
File "/usr/lib/python2.7/site-packages/trashcli/trash.py", line 83, in path_to
out('%(HOME)s/.local/share/Trash' % self.environ)
File "/usr/lib/python2.7/site-packages/trashcli/trash.py", line 392, in return_result_with_volume
self.on_trash_dir_found(trashcan_path, '/')
File "/usr/lib/python2.7/site-packages/trashcli/trash.py", line 481, in _analize_trash_directory
self.trashdir.each_trashinfo(self.on_trashinfo_found)
File "/usr/lib/python2.7/site-packages/trashcli/trash.py", line 573, in each_trashinfo
action(os.path.join(self._info_dir(), entry))
File "/usr/lib/python2.7/site-packages/trashcli/trash.py", line 365, in delete_if_expired
self._maybe_delete(trashinfo_path)
File "/usr/lib/python2.7/site-packages/trashcli/trash.py", line 375, in _delete_unconditionally
self._trashcan.delete_trashinfo_and_backup_copy(trashinfo_path)
File "/usr/lib/python2.7/site-packages/trashcli/trash.py", line 348, in delete_trashinfo_and_backup_copy
self._file_remover.remove_file_if_exists(backup_copy)
File "/usr/lib/python2.7/site-packages/trashcli/fs.py", line 27, in remove_file_if_exists
if os.path.exists(path): self.remove_file(path)
File "/usr/lib/python2.7/site-packages/trashcli/fs.py", line 25, in remove_file
shutil.rmtree(path)
File "/usr/lib/python2.7/shutil.py", line 239, in rmtree
onerror(os.listdir, path, sys.exc_info())
File "/usr/lib/python2.7/shutil.py", line 237, in rmtree
names = os.listdir(path)
OSError: [Errno 13] Permission denied: '/home/fturco/.local/share/Trash/files/test'
I'm using trash-cli-0.12.9.14.r34.g7913a0b-3 on a Parabola GNU/Linux-libre system.
from trash-cli.
trash-empty should skip the file and not change the permissions.
from trash-cli.
I run trash-empty 7
from a crontab job, so I'd prefer trash-cli to not skip these files silently, otherwise the trash would contain these offending files forever, and I'd never know. Ideally, I'd like it to trash them even if it doesn't have write permissions. Perhaps there could be a -f
flag to force deletion, regardless of permissions?
from trash-cli.
Related Issues (20)
- verbose output HOT 1
- trash-empty: option to only empty files trashed prior to application start HOT 1
- Confirm Dialog on `trash-empty` HOT 5
- trash-put: cannot trash regular file @raffaem
- Slow trash-empty taking hours to delete HOT 1
- If a trash fails before everything is deleted, all the files that *were* deleted *cannot be restored* HOT 9
- Provide an option to send deleted items to macOS Desktop Trash. HOT 6
- Hitting return on trash-restore without entering a number results in unclear behavior HOT 1
- Crash while removing file/dir wth utf-8 chars HOT 2
- [Question] How to correctly answer "Proceed? (y/n)" when using trash-empty in script? HOT 4
- Crash with `--volumes`: AttributeError: 'PrintVolumesList' object has no attribute 'run_action' HOT 1
- ZSH completion very slow HOT 3
- Add option to preserve folders containing recently modified files
- ZSH completion does not allow to specify multiple files to trash HOT 1
- Don't force user to install old mock library HOT 10
- I have a number of bind mounts, and `trash-list` shows trashed items without any duplication. HOT 4
- having `--dry-run` for `trash-put` HOT 4
- PermissionError in trash-empty incorrectly user's .Trash folder HOT 1
- Add a way to trash from stdin HOT 2
- Permission denied: '/proc/filesystems' on Termux HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trash-cli.