[Bug 310088] [NEW] restore-trash crashes if the original path does not exist (even if it's in the same trash can)
Christoph Bloch
christoph at webrahmen.ch
Sat Dec 20 22:15:52 UTC 2008
Public bug reported:
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://ch.archive.ubuntu.com intrepid/universe Packages
100 /var/lib/dpkg/status
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/EXTERN/_lagaffe bis 070907/000-132.jpg
52 2008-12-20 22:46:13 /media/EXTERN/_lagaffe bis 070907/000-133.jpg
53 2008-12-20 22:46:13 /media/EXTERN/_lagaffe bis 070907/goodies_gaston.gif
54 2008-12-20 22:46:37 /media/EXTERN/_lagaffe bis 070907
What file to restore [0..54]: 51
Traceback (most recent call last):
File "/usr/bin/restore-trash", line 39, in <module>
list[index].restore()
File "/var/lib/python-support/python2.5/libtrash/__init__.py", line 418, in restore
self.original_file.move(self.path)
File "/var/lib/python-support/python2.5/libtrash/__init__.py", line 67, in move
return shutil.move(self.path, str(dest))
File "/usr/lib/python2.5/shutil.py", line 205, in move
copy2(src,dst)
File "/usr/lib/python2.5/shutil.py", line 96, in copy2
copyfile(src, dst)
File "/usr/lib/python2.5/shutil.py", line 52, in copyfile
fdst = open(dst, 'wb')
IOError: [Errno 2] No such file or directory: '/media/EXTERN/_lagaffe bis 070907/000-132.jpg'
===
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!
** Affects: trash-cli (Ubuntu)
Importance: Undecided
Status: New
--
restore-trash crashes if the original path does not exist (even if it's in the same trash can)
https://bugs.launchpad.net/bugs/310088
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
ubuntu-bugs at lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
More information about the universe-bugs
mailing list