From 7b5772df2d68b544ac90bf670efcf24ebdf7a6c9 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Wed, 10 Aug 2016 13:56:06 +0200 Subject: [PATCH] add transaction_id assertion an acd_cli (amazon cloud drive fuse filesystem) user had "borg init" crash in the line below. by adding the assertion we tell that we do not expect the transaction_id to be None there, so it is easier to differentiate from a random coding error. --- borg/repository.py | 1 + 1 file changed, 1 insertion(+) diff --git a/borg/repository.py b/borg/repository.py index 686f30a7d..c33f49da9 100644 --- a/borg/repository.py +++ b/borg/repository.py @@ -248,6 +248,7 @@ class Repository: b'segments': self.segments, b'compact': list(self.compact)} transaction_id = self.io.get_segments_transaction_id() + assert transaction_id is not None hints_file = os.path.join(self.path, 'hints.%d' % transaction_id) with open(hints_file + '.tmp', 'wb') as fd: msgpack.pack(hints, fd)