SX backend issues

Bug #1454136 reported by Tom Shanders
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Duplicity
Medium
Unassigned

Bug Description

There is a small issue with the sx backend which fails when the sx path doesn't contain a trailing slash.

For example this works:
duplicity remove-all-but-n-full 2 --force sx://@cluster/backup/pc1/

But this doesn't:
duplicity remove-all-but-n-full 2 --force sx://@cluster/backup/pc1
and results in:
Error:
Reading results of 'sxls sx://@cluster/backup/pc1'
Backtrace of previous error: Traceback (innermost last):
  File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 365, in inner_retry
    return fn(self, *args)
  File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 564, in list
    return [tobytes(x) for x in self.backend._list()]
  File "/usr/lib/python2.7/dist-packages/duplicity/backends/sxbackend.py", line 46, in _list
    return [x[x.rindex('/') + 1:].split()[-1] for x in l.split('\n') if x and not x.startswith("total ")]
 IndexError: list index out of range

The stupid patch attached makes sure the trailing slash is always present.

On a side note all the calls to self.subprocess_popen appear to feed unescaped arguments to the shell. This is however not specific to the sx backend.

Revision history for this message
Tom Shanders (tomshanders) wrote :
Changed in duplicity:
milestone: none → 0.8.19
importance: Undecided → Medium
status: New → Fix Committed
Changed in duplicity:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers