onedrive backend uses 'unicode' constructor from python2.7 and fails

Bug #1856447 reported by Enno L
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Duplicity
Fix Released
Medium
Unassigned

Bug Description

The onedrive backend uses the 'unicode' constructor from Python2.7. This leads to:
 "NameError: name 'unicode' is not defined"

Duplicity version: 0.8.08
Python: Python 3.6.9 (default, Dec 8 2019, 01:17:00)
[GCC 4.2.1 Compatible FreeBSD Clang 6.0.1 (tags/RELEASE_601/final 335540)] on freebsd12
OS Distro and version: FreeBSD BSDServer 12.0-RELEASE-p10 FreeBSD 12.0-RELEASE-p10 GENERIC amd64
Type of target system: Onedrive

Error log:
Rückverfolgung des vorangegangenen Fehlers: Traceback (innermost last):
  File "/usr/local/lib/python3.6/site-packages/duplicity/backend.py", line 371, in inner_retry
    return fn(self, *args)
  File "/usr/local/lib/python3.6/site-packages/duplicity/backend.py", line 531, in put
    self.__do_put(source_path, remote_filename)
  File "/usr/local/lib/python3.6/site-packages/duplicity/backend.py", line 517, in __do_put
    self.backend._put(source_path, remote_filename)
  File "/usr/local/lib/python3.6/site-packages/duplicity/backends/onedrivebackend.py", line 262, in _put
    u'Content-Length': unicode(len(chunk)),
 NameError: name 'unicode' is not defined

Revision history for this message
Enno L (ennol) wrote :

A possible fix for this could be in onedrivebackend.py:

262c262
< u'Content-Length': unicode(len(chunk)),
---
> u'Content-Length': u'%d' % len(chunk),

description: updated
Changed in duplicity:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Kenneth Loafman (kenneth-loafman)
milestone: none → 0.8.09
Changed in duplicity:
status: In Progress → Fix Committed
assignee: Kenneth Loafman (kenneth-loafman) → nobody
Changed in duplicity:
status: Fix Committed → Fix Released
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.