restore-trash crashes if the original path does not exist (even if it's in the same trash can)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
trash-cli (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: trash-cli
1) Ubuntu 8.10, all updates applied (2008-12-20)
2) trash-cli:
Installed: 0.10.r55-0ubuntu1
Candidate: 0.10.r55-0ubuntu1
Version table:
*** 0.10.r55-0ubuntu1 0
500 http://
100 /var/lib/
3) What I did:
- trashed all files from a directory
- trashed the directory itself
- tried to restore-trash a file from the directory
What happened (from the terminal):
===
$ restore-trash
(...)
51 2008-12-20 22:46:13 /media/
52 2008-12-20 22:46:13 /media/
53 2008-12-20 22:46:13 /media/
54 2008-12-20 22:46:37 /media/
What file to restore [0..54]: 51
Traceback (most recent call last):
File "/usr/bin/
list[
File "/var/lib/
self.
File "/var/lib/
return shutil.
File "/usr/lib/
copy2(src,dst)
File "/usr/lib/
copyfile(src, dst)
File "/usr/lib/
fdst = open(dst, 'wb')
IOError: [Errno 2] No such file or directory: '/media/
===
4) What I expected to happen:
restore-trash should:
a) automatically restore/create the original directory where the file used to live (acceptable solution), or
b) at least understand the problem and tell me to restore/create the directory first, and then exit (poor option), or
c) ask me if I want it to (1) restore/create the directory and to restore the file or (2) cancel everything (best option in my opinion).
In any case, restore-trash should cope with the various problems that can occur when trying to restore the directory:
* it may be on a partition that has been unmounted,
* the user may have removed it with rm instead of trash, so it cannot be restore-trashed itself, or
* there may be several levels of directories missing (and they may be trashed or removed, or a mix of both), or
* there may be a permissions issue, or
* etc.
Thanks for working on this long-awaited little (but not so trivial) tool!
Changed in trash-cli (Ubuntu): | |
status: | New → Incomplete |
status: | Incomplete → New |
Changed in trash-cli (Ubuntu): | |
status: | New → Fix Released |
Hi,
I'm the writer of trash-cli.
Would you test if the reported behaviour will occour with the latest development version of trash-cli?
To install the last version:
sudo apt-get remove trash-cli
sudo easy_install trash-cli
If you don't have easy_install you could install it with "apt-get install python-setuptools".
Please note that the new version of trash-cli uses a different command nams (trash-file instead of trash, trash-list instead of list-trash, trash-empty instead of empty-trash).