storage: keep non-utf8 strings as bytes (#38021)
(this is not supposed to exist)
This commit is contained in:
parent
f088bf40bc
commit
ce81160605
|
@ -114,7 +114,10 @@ def deep_bytes2str(obj, seen=None):
|
|||
if id(obj) in seen:
|
||||
return obj
|
||||
if isinstance(obj, bytes):
|
||||
return obj.decode('utf-8')
|
||||
try:
|
||||
return obj.decode('utf-8')
|
||||
except UnicodeDecodeError:
|
||||
return obj
|
||||
seen[id(obj)] = True
|
||||
if isinstance(obj, dict):
|
||||
new_d = {}
|
||||
|
|
Loading…
Reference in New Issue