mirror of
https://github.com/borgbackup/borg.git
synced 2025-01-03 13:45:31 +00:00
msgpack: require msgpack >= 1.0.3
... and remove support code for older versions.
This commit is contained in:
parent
9e669f6db8
commit
0937ae9078
2 changed files with 9 additions and 14 deletions
2
setup.py
2
setup.py
|
@ -66,7 +66,7 @@
|
|||
install_requires = [
|
||||
# we are rather picky about msgpack versions, because a good working msgpack is
|
||||
# very important for borg, see: https://github.com/borgbackup/borg/issues/3753
|
||||
'msgpack >=0.5.6, <=1.0.3, !=1.0.1',
|
||||
'msgpack >=1.0.3, <=1.0.3',
|
||||
# Please note:
|
||||
# using any other version is not supported by borg development and
|
||||
# any feedback related to issues caused by this will be ignored.
|
||||
|
|
|
@ -30,8 +30,6 @@
|
|||
|
||||
version = mp_version
|
||||
|
||||
_post_100 = version >= (1, 0, 0)
|
||||
|
||||
|
||||
class PackException(Exception):
|
||||
"""Exception while msgpack packing"""
|
||||
|
@ -99,9 +97,8 @@ def __init__(self, file_like=None, *, read_size=0, use_list=True, raw=True,
|
|||
max_bin_len=max_bin_len,
|
||||
max_array_len=max_array_len,
|
||||
max_map_len=max_map_len,
|
||||
max_ext_len=max_ext_len)
|
||||
if _post_100:
|
||||
kw['strict_map_key'] = strict_map_key
|
||||
max_ext_len=max_ext_len,
|
||||
strict_map_key=strict_map_key)
|
||||
super().__init__(**kw)
|
||||
|
||||
def unpack(self):
|
||||
|
@ -138,10 +135,9 @@ def unpackb(packed, *, raw=True, unicode_errors=None,
|
|||
max_bin_len=max_bin_len,
|
||||
max_array_len=max_array_len,
|
||||
max_map_len=max_map_len,
|
||||
max_ext_len=max_ext_len)
|
||||
max_ext_len=max_ext_len,
|
||||
strict_map_key=strict_map_key)
|
||||
kw.update(kwargs)
|
||||
if _post_100:
|
||||
kw['strict_map_key'] = strict_map_key
|
||||
return mp_unpackb(packed, **kw)
|
||||
except Exception as e:
|
||||
raise UnpackException(e)
|
||||
|
@ -162,10 +158,9 @@ def unpack(stream, *, raw=True, unicode_errors=None,
|
|||
max_bin_len=max_bin_len,
|
||||
max_array_len=max_array_len,
|
||||
max_map_len=max_map_len,
|
||||
max_ext_len=max_ext_len)
|
||||
max_ext_len=max_ext_len,
|
||||
strict_map_key=strict_map_key)
|
||||
kw.update(kwargs)
|
||||
if _post_100:
|
||||
kw['strict_map_key'] = strict_map_key
|
||||
return mp_unpack(stream, **kw)
|
||||
except Exception as e:
|
||||
raise UnpackException(e)
|
||||
|
@ -182,8 +177,8 @@ def is_slow_msgpack():
|
|||
def is_supported_msgpack():
|
||||
# DO NOT CHANGE OR REMOVE! See also requirements and comments in setup.py.
|
||||
import msgpack
|
||||
return (0, 5, 6) <= msgpack.version <= (1, 0, 3) and \
|
||||
msgpack.version not in [(1, 0, 1), ] # < add bad releases here to deny list
|
||||
return (1, 0, 3) <= msgpack.version <= (1, 0, 3) and \
|
||||
msgpack.version not in [] # < add bad releases here to deny list
|
||||
|
||||
|
||||
def get_limited_unpacker(kind):
|
||||
|
|
Loading…
Reference in a new issue