seek(0) on /dev/stdin crashes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Duplicity |
Fix Released
|
Medium
|
Unassigned |
Bug Description
$ duplicity --version
duplicity 0.7.06
$ python --version
Python 3.5.2 :: Anaconda 4.1.1 (64-bit)
I receive this crash on ubuntu 16.04 (after dist-upgrading from 14.04):
Reading globbing filelist /dev/stdin
Using temporary directory /tmp/duplicity-
Traceback (most recent call last):
File "/usr/bin/
with_
File "/usr/bin/
fn()
File "/usr/bin/
action = commandline.
File "/usr/lib/
set_selection()
File "/usr/lib/
sel.
File "/usr/lib/
for sf in self.filelist_
File "/usr/lib/
filelist_
IOError: [Errno 29] Illegal seek
I think it is because i do something like:
$ find /home/ -size +800M | duplicity --exclude-
But.. On linux, you cannot seek on stdin, if stdin arrives from a pipe. You could, if it had been a file-redirection, like so:
$ program_
but not:
$ cat file.txt | program_
In my case, i solved it by wrapping the seek in a "try: except: pass" block, but that might not be a solution if the file-descriptor has already been read and the position actually needs to be reset.
Changed in duplicity: | |
importance: | Undecided → Medium |
milestone: | none → 0.8.19 |
status: | New → Fix Committed |
Changed in duplicity: | |
status: | Fix Committed → Fix Released |
I ran into to this again, after upgrading to the newest version, to get a fix for another bug.
This time i remembered to take a diff :). Patch-file attached.