From c0a617c6a9ed33de2e48e7658936f36d254533ff Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Mon, 1 Jul 2019 21:26:04 +0200 Subject: [PATCH 1/2] cope with ANY error when importing pytest into borg.testsuite, #4652 this happened because the user had pytest5 installed somehow, although it is incompatible with python 3.4: # python3 /usr/local/bin/borg --version Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/borg/archiver.py", line 81, in from .selftest import selftest File "/usr/local/lib/python3.4/dist-packages/borg/selftest.py", line 21, in from .testsuite.hashindex import HashIndexDataTestCase, HashIndexRefcountingTestCase, HashIndexTestCase File "/usr/local/lib/python3.4/dist-packages/borg/testsuite/__init__.py", line 29, in from pytest import raises File "/usr/local/lib/python3.4/dist-packages/pytest.py", line 6, in from _pytest.assertion import register_assert_rewrite File "/usr/local/lib/python3.4/dist-packages/_pytest/assertion/__init__.py", line 6, in from _pytest.assertion import rewrite File "/usr/local/lib/python3.4/dist-packages/_pytest/assertion/rewrite.py", line 443, in ast.MatMult: "@", AttributeError: 'module' object has no attribute 'MatMult' --- src/borg/testsuite/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/borg/testsuite/__init__.py b/src/borg/testsuite/__init__.py index 2658cff2e..57743e45a 100644 --- a/src/borg/testsuite/__init__.py +++ b/src/borg/testsuite/__init__.py @@ -31,7 +31,7 @@ except ImportError: try: from pytest import raises -except ImportError: +except: # noqa raises = None has_lchflags = hasattr(os, 'lchflags') or sys.platform.startswith('linux') From 097677b14f0f4fd7f7b4fd168a7e74d9350e7b21 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Fri, 28 Jun 2019 21:10:58 +0200 Subject: [PATCH 2/2] fix preloading for old remote servers, fixes #4652 if the remote server does not support the dict-based argument passing yet (e.g. when accidentally using borg 0.29 on rsync.net), the GET rpc call argument list failed to generate if the command currently being processed was not a GET also. note: rsync.net has a more recent borg as "borg1". --- src/borg/remote.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/borg/remote.py b/src/borg/remote.py index 56ad6c765..dce028801 100644 --- a/src/borg/remote.py +++ b/src/borg/remote.py @@ -872,7 +872,7 @@ This problem will go away as soon as the server has been upgraded to 1.0.7+. if self.dictFormat: self.to_send = msgpack.packb({MSGID: self.msgid, MSG: 'get', ARGS: args}) else: - self.to_send = msgpack.packb((1, self.msgid, 'get', self.named_to_positional(cmd, args))) + self.to_send = msgpack.packb((1, self.msgid, 'get', self.named_to_positional('get', args))) if self.to_send: try: