Merge pull request #9790 from ThomasWaldmann/support-msgpack121-1.4
Some checks failed
CI / lint (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
Windows CI / msys2-ucrt64 (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled

support msgpack 1.2.1
This commit is contained in:
TW 2026-06-18 23:02:54 +02:00 committed by GitHub
commit 5bfbfacf16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 25 additions and 12 deletions

View file

@ -473,7 +473,7 @@ Note: Many of the fixed issues listed below relate to rather rare or theoretical
Other changes:
- msgpack: allow 1.2.0
- msgpack: also allow 1.2.0 and 1.2.1
- use F_FULLFSYNC on macOS for SyncFile data durability, #9383
- mount: improve error msg when uid/gid cannot be resolved, #9574
- docs:

View file

@ -35,7 +35,7 @@ dependencies = [
# Please note:
# Using any other msgpack version is not supported by Borg development and
# any feedback related to issues caused by this will be ignored.
"msgpack >=1.0.3, <=1.2.0",
"msgpack >=1.0.3, <=1.2.1",
"packaging",
]

View file

@ -1035,22 +1035,35 @@ Utilization of max. archive size: {csize_max:.0%}
data = self.key.decrypt(items_id, data)
unpacker.feed(data)
chunk_decref(items_id, stats)
try:
for item in unpacker:
while True:
try:
item = next(unpacker)
except StopIteration:
# no more (complete) items in the buffer, feed the next chunk
break
except msgpack.UnpackException:
# items metadata corrupted. the unpacker can't be reused after an
# unpacking failure, so create a fresh one and skip the rest of this chunk.
if forced == 0:
raise
error = True
unpacker = msgpack.Unpacker(use_list=False)
break
try:
item = Item(internal_dict=item)
if 'chunks' in item:
part = not self.consider_part_files and 'part' in item
for chunk_id, size, csize in item.chunks:
chunk_decref(chunk_id, stats, part=part)
except (TypeError, ValueError):
# if items metadata spans multiple chunks and one chunk got dropped somehow,
# it could be that unpacker yields bad types
if forced == 0:
raise
error = True
except (TypeError, ValueError):
# if items metadata spans multiple chunks and one chunk got dropped somehow,
# it could be that unpacker yields bad types
if forced == 0:
raise
error = True
if progress:
pi.finish()
except (msgpack.UnpackException, Repository.ObjectNotFound):
except Repository.ObjectNotFound:
# items metadata corrupted
if forced == 0:
raise

View file

@ -145,7 +145,7 @@ def is_supported_msgpack():
version_check = os.environ.get('BORG_MSGPACK_VERSION_CHECK', 'yes').strip().lower()
return version_check == 'no' or (
(1, 0, 3) <= msgpack.version[:3] <= (1, 2, 0) and
(1, 0, 3) <= msgpack.version[:3] <= (1, 2, 1) and
msgpack.version not in []
)