1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-23 16:26:29 +00:00

Key: fix once, remove decode=...

This commit is contained in:
Thomas Waldmann 2022-05-30 13:38:05 +02:00
parent ed22f721f3
commit 58009f6773

View file

@ -465,10 +465,10 @@ class Key(PropDict):
__slots__ = ("_dict", ) # avoid setting attributes not supported by properties
version = PropDict._make_property('version', int)
repository_id = PropDict._make_property('repository_id', bytes, decode=want_bytes)
enc_key = PropDict._make_property('enc_key', bytes, decode=want_bytes)
enc_hmac_key = PropDict._make_property('enc_hmac_key', bytes, decode=want_bytes)
id_key = PropDict._make_property('id_key', bytes, decode=want_bytes)
repository_id = PropDict._make_property('repository_id', bytes)
enc_key = PropDict._make_property('enc_key', bytes)
enc_hmac_key = PropDict._make_property('enc_hmac_key', bytes)
id_key = PropDict._make_property('id_key', bytes)
chunk_seed = PropDict._make_property('chunk_seed', int)
tam_required = PropDict._make_property('tam_required', bool)
@ -478,6 +478,8 @@ class Key(PropDict):
k = fix_key(d, k)
if k == 'version':
assert isinstance(v, int)
if k in ('repository_id', 'enc_key', 'enc_hmac_key', 'id_key'):
v = fix_bytes_value(d, k)
self._dict[k] = v