B2ProgressListener instance has no attribute '__exit__'

Bug #1803896 reported by Slawek Bunka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Duplicity
Fix Released
Medium
Unassigned

Bug Description

Duplicity 0.7.17
Python 2.7.15
MacOS 10.14.1 and Ubuntu 18.04.1

Backing up to Backblaze B2 fails with the following:

~$ duplicity test.txt b2://acc:key@bucket
Local and Remote metadata are synchronized, no sync needed.
Last full backup date: none
No signatures found, switching to full backup.
Attempt 1 failed. AttributeError: B2ProgressListener instance has no attribute '__exit__'

It then retries several times but never succeeds. This happens for me with Python 2.7.15 and duplicity 0.7.17 on both MacOS 10.14.1 (python and duplicity from MacPorts) and on Ubuntu 18.04.1 LTS

I came up with the following patch to work around this problem, not sure if that's the correct solution, i.e. there may be some implications to this that I am not aware of:

--- duplicity/backends/b2backend.py.bak 2018-11-18 00:13:48.175867382 +0100
+++ duplicity/backends/b2backend.py 2018-11-18 00:14:24.785080193 +0100
@@ -32,6 +32,9 @@

 class B2ProgressListener:
+ def __enter__(self):
+ pass
+
     def set_total_bytes(self, total_byte_count):
         self.total_byte_count = total_byte_count

@@ -41,6 +44,8 @@
     def close(self):
         pass

+ def __exit__(self, exc_type, exc_val, exc_tb):
+ pass

 class B2Backend(duplicity.backend.Backend):
     """

Tags: b2 backend
Revision history for this message
Slawek Bunka (slawekbunka) wrote :
Changed in duplicity:
importance: Undecided → Medium
milestone: none → 0.8.00
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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