Skip to content
Snippets Groups Projects
Commit c900670d authored by vlorentz's avatar vlorentz
Browse files

msgpack.unpackb: Use raw=False when possible.

Summary: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.

Reviewers: #reviewers, zack

Reviewed By: #reviewers, zack

Subscribers: zack, olasd, swh-public-ci

Differential Revision: https://forge.softwareheritage.org/D628
parent 69e82bc3
No related branches found
No related tags found
1 merge request!22msgpack.unpackb: Use raw=False when possible.
......@@ -183,4 +183,9 @@ def msgpack_loads(data):
return arrow.get(obj[b's'])
return obj
return msgpack.unpackb(data, encoding='utf-8', object_hook=decode_types)
try:
return msgpack.unpackb(data, raw=False,
object_hook=decode_types)
except TypeError: # msgpack < 0.5.2
return msgpack.unpackb(data, encoding='utf-8',
object_hook=decode_types)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment