mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
salt.payload.Serial: fix traceback when unpacking binary blob
This commit is contained in:
parent
40a49358c9
commit
df43ffdb8f
1 changed files with 5 additions and 1 deletions
|
@ -141,7 +141,11 @@ class Serial(object):
|
|||
# Due to this, if we don't need it, don't pass it at all so
|
||||
# that under Python 2 we can still work with older versions
|
||||
# of msgpack.
|
||||
ret = msgpack.loads(msg, use_list=True, ext_hook=ext_type_decoder, encoding=encoding)
|
||||
try:
|
||||
ret = msgpack.loads(msg, use_list=True, ext_hook=ext_type_decoder, encoding=encoding)
|
||||
except UnicodeDecodeError:
|
||||
# msg contains binary data
|
||||
ret = msgpack.loads(msg, use_list=True, ext_hook=ext_type_decoder)
|
||||
else:
|
||||
ret = msgpack.loads(msg, use_list=True, ext_hook=ext_type_decoder)
|
||||
if six.PY3 and encoding is None and not raw:
|
||||
|
|
Loading…
Add table
Reference in a new issue