Skip to content

borg2: cleanup msgpack related str/bytes mess#6704

Merged
ThomasWaldmann merged 14 commits intoborgbackup:borg2from
ThomasWaldmann:msgpack-str-bytes-cleanup
Jun 9, 2022
Merged

borg2: cleanup msgpack related str/bytes mess#6704
ThomasWaldmann merged 14 commits intoborgbackup:borg2from
ThomasWaldmann:msgpack-str-bytes-cleanup

Conversation

@ThomasWaldmann
Copy link
Copy Markdown
Member

@ThomasWaldmann ThomasWaldmann commented May 18, 2022

based on #6703, see the last commits.

@ThomasWaldmann ThomasWaldmann changed the title Msgpack str bytes cleanup cleanup msgpack related str/bytes mess May 18, 2022
@ThomasWaldmann ThomasWaldmann changed the title cleanup msgpack related str/bytes mess borg2: cleanup msgpack related str/bytes mess May 18, 2022
@ThomasWaldmann ThomasWaldmann force-pushed the msgpack-str-bytes-cleanup branch 2 times, most recently from 7f1b0e0 to 01bdae6 Compare May 29, 2022 15:34
see ticket and borg.helpers.msgpack docstring.
see ticket and borg.helpers.msgpack docstring.

this changeset implements the full migration to
msgpack 2.0 spec (use_bin_type=True, raw=False).

still needed compat to the past is done via want_bytes decoder in borg.item.
update_internal() makes sure they have the desired type already.
also: fixed Item.xattrs to be StableDict (not just a dict, as the
msgpack unpacker gives us)
Item.xattrs is now always a StableDict mapping bytes keys -> bytes values.

The special casing of empty values (b'') getting replaced by None was removed.
If we do not know the value, just do not have that key/value pair in the item.
@ThomasWaldmann ThomasWaldmann force-pushed the msgpack-str-bytes-cleanup branch from 4f2768f to 08228fb Compare June 9, 2022 15:58
also, some type conversions are now done in update_internal once,
not in the decode methods of the classes in item.pyx.
@ThomasWaldmann ThomasWaldmann merged commit 2c9be35 into borgbackup:borg2 Jun 9, 2022
@ThomasWaldmann ThomasWaldmann deleted the msgpack-str-bytes-cleanup branch June 9, 2022 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant