storage: always convert dictionaries bytes (#39318)
This commit is contained in:
parent
aa2e475fd7
commit
7a663969bf
|
@ -122,14 +122,14 @@ def deep_bytes2str(obj, seen=None):
|
|||
return obj
|
||||
if isinstance(obj, list):
|
||||
return [deep_bytes2str(x, seen) for x in obj]
|
||||
if id(obj) in seen:
|
||||
return obj
|
||||
seen[id(obj)] = True
|
||||
if isinstance(obj, dict):
|
||||
new_d = {}
|
||||
for k, v in obj.items():
|
||||
new_d[force_str(k)] = deep_bytes2str(v, seen)
|
||||
return new_d
|
||||
if id(obj) in seen:
|
||||
return obj
|
||||
seen[id(obj)] = True
|
||||
if hasattr(obj, '__class__') and obj.__class__.__module__.startswith(('wcs.', 'qommon.', 'modules.')):
|
||||
obj.__dict__ = deep_bytes2str(obj.__dict__, seen)
|
||||
return obj
|
||||
|
|
Loading…
Reference in New Issue