webdavbackend.py: expected bytes-like object, not str

Bug #1846167 reported by Dr. Michael Hälsig
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Duplicity
Fix Released
Medium
Unassigned

Bug Description

A long running script now returns an error. It seems to be that webdavbackend.py does not conform to newest Python standards. I am using duplicity 8.04. My webdav user name is '<email address hidden>' - entering in Bash with double quotes worked until now, now I entered michael.haelsig\@online.de. Both variants fail.

duplicity $version ($reldate)
Args: /usr/bin/duplicity --verbosity debug --volsize=100 /home/mhaelsig/Skripte webdavs://<email address hidden>:<email address hidden>/Test
Linux Debian9 5.2.0-2-amd64 #1 SMP Debian 5.2.9-2 (2019-08-21) x86_64
/usr/bin/python3 3.7.4+ (default, Sep 4 2019, 08:03:05)
[GCC 9.2.1 20190827]
================================================================================
Temporäres Verzeichnis /tmp/duplicity-tik_134h-tempdir wird benutzt
(mkstemp) temporäre Datei /tmp/duplicity-tik_134h-tempdir/mkstemp-ajccro_7-1 wird registriert
9445765120 temporärer Speicherplatz ist verfügbar, die Sicherung wird ungefähr 136314880 nutzen.
WebDAV erzeugt eine Verbindung unter 'sd2dav.1und1.de'
WebDAV PROPFIND /Test/ Anfrage mit Headern: {'Connection': 'keep-alive', 'Depth': '1'}
WebDAV Datenlänge: 95
WebDAV Antwortstatus 401 mit dem Grund 'Unauthorized'.
Rückverfolgung des vorangegangenen Fehlers: Traceback (innermost last):
  File "/usr/lib/python3/dist-packages/duplicity/backend.py", line 371, in inner_retry
    return fn(self, *args)
  File "/usr/lib/python3/dist-packages/duplicity/backend.py", line 580, in list
    return [tobytes(x) for x in self.backend._list()]
  File "/usr/lib/python3/dist-packages/duplicity/backends/webdavbackend.py", line 343, in _list
    raise e
  File "/usr/lib/python3/dist-packages/duplicity/backends/webdavbackend.py", line 317, in _list
    response = self.request(u"PROPFIND", self.directory, self.listbody)
  File "/usr/lib/python3/dist-packages/duplicity/backends/webdavbackend.py", line 240, in request
    self.headers[u'Authorization'] = self.get_authorization(response, quoted_path)
  File "/usr/lib/python3/dist-packages/duplicity/backends/webdavbackend.py", line 271, in get_authorization
    return self.get_basic_authorization()
  File "/usr/lib/python3/dist-packages/duplicity/backends/webdavbackend.py", line 291, in get_basic_authorization
    return u'Basic %s' % base64.encodestring(auth_string).strip()
  File "/usr/lib/python3.7/base64.py", line 540, in encodestring
    return encodebytes(s)
  File "/usr/lib/python3.7/base64.py", line 527, in encodebytes
    _input_type_check(s)
  File "/usr/lib/python3.7/base64.py", line 513, in _input_type_check
    raise TypeError(msg) from err
 TypeError: expected bytes-like object, not str

Changed in duplicity:
importance: Undecided → Medium
milestone: none → 0.8.05
status: New → Fix Committed
Changed in duplicity:
status: Fix Committed → Fix Released
Revision history for this message
Martin (martin-troiber) wrote :

As I'm currently also facing this problem while restoring my data could you update the official repositories to version 0.8.05 or higher?
In the mean time how do I update duplicity to a version that's not in the official repositories for Ubuntu?
Thanks for maintaing the project. Your help is greatly appreciated.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.