Switch to python3 is causing mediafire backend to fail
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Duplicity |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Since switch to `python3` (`duplicity 0.8.10`) there's an issue with mediafire backend.
```
duplicity full -v9 --no-encryption /etc/resolv.conf mf://use.
..
..
Backtrace of previous error: Traceback (innermost last):
File "/usr/lib/
return fn(self, *args)
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
uri = self._build_
File "/usr/lib/
(u'/' + filename if filename else u'')
TypeError: can only concatenate str (not "bytes") to str
Attempt 1 failed. TypeError: can only concatenate str (not "bytes") to str
```
the issue is that `filename` is bytes object and while python2 happily accepts it, python3 throws an exception:
```
python2 -c "b'' + ''" # all good
python3 -c "b'' + ''" # can't concat str to bytes!!
```
duplicity 0.8.10fin
Python 3.8.1 (default, Jan 22 2020, 06:38:00)
Arch Linux, current
Changed in duplicity: | |
status: | In Progress → Fix Committed |
Changed in duplicity: | |
status: | Fix Committed → Fix Released |
a quick (and untested) way to fix the problem is modification of _build_uri function in mediafirebacken d.py:
def _build_uri(self, filename=None): u"folderkey" ] +
u"""Build relative URI"""
filename = filename.decode() if filename else None
return (
u'mf:' + self.folder[
(u'/' + filename if filename else u'')
)