New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cleanup msgpack str/bytes type mess #968
Comments
Just tried switching msgpack to the 2.0 spec format. Lots of changes in the code and tests are needed for that (but it gets prettier, usually no I'ld like to have the new msgpack format at least for all persistent data structures (repo, archives, items, keys, ...). But: the RPC protocol also uses msgpack, so we would need the old format to talk to old borg servers. Also, in the old archives, items, ... we of course also have serialized with the old format. Any idea how that could nicely work without duplicating lots of code? |
see ticket and borg.helpers.msgpack docstring.
see ticket and borg.helpers.msgpack docstring.
see ticket and borg.helpers.msgpack docstring.
see ticket and borg.helpers.msgpack docstring.
see ticket and borg.helpers.msgpack docstring.
Hmm, weird idea about how to finish with this right now: If we would tell the unpacker to use
|
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.
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.
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.
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.
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.
This is mostly done for now, see the code in borg2 branch. The only thing left to do is all the "we know what it should be" style type conversion code in |
old msgpack
new msgpack (2.0 spec)
text
is identical toraw
!encoding_errors
defaults tostrict
for both pack and unpack, but guess it could besurrogateescape
also.msgpack and borg
using old msgpack format is the cause for the ugly bytes-type keys in item dict (
item[b'source']
), see also #926.by using an
Item
class it got a bit prettier a while ago, see #981.borg 1.2 added
borg.helpers.msgpack
compatibility wrapper.Breaking:
are we lucky?
new packb serialises
'foo'
in same way as old packb serializedb'foo'
, so we can just drop theb
everywhere.we just need to be careful:
borg 1.3
borg 2.0
The text was updated successfully, but these errors were encountered: