From e6911b2f254bef8a3968a48dcdc59c8e2931933a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ketelaars?= Date: Sun, 8 Nov 2015 14:24:58 +0100 Subject: [PATCH] Avoid using msgpack.packb at import time. move item_keys = ... to __init__ (self.item_keys = ...) Solution from/discussed with TW. --- borg/archive.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/borg/archive.py b/borg/archive.py index 7edd4162a..008909a2f 100644 --- a/borg/archive.py +++ b/borg/archive.py @@ -605,10 +605,9 @@ ITEM_KEYS = set([b'path', b'source', b'rdev', b'chunks', class RobustUnpacker: """A restartable/robust version of the streaming msgpack unpacker """ - item_keys = [msgpack.packb(name) for name in ITEM_KEYS] - def __init__(self, validator): super().__init__() + self.item_keys = [msgpack.packb(name) for name in ITEM_KEYS] self.validator = validator self._buffered_data = [] self._resync = False