refac
Co-Authored-By: Zixin Yu <183055163+ivvi0927@users.noreply.github.com>
This commit is contained in:
1 parent
fd76b51ab2
commit
e3ab4bd212
1 file changed
+1
-1
@@ -711,7 +711,7 @@ def sanitize_data_for_db(obj):
|
|||||||
# json.dumps is implemented in C and much faster than a Python-level
|
# json.dumps is implemented in C and much faster than a Python-level
|
||||||
# recursive walk over every leaf string.
|
# recursive walk over every leaf string.
|
||||||
try:
|
try:
|
||||||
if '\x00' not in json.dumps(obj, ensure_ascii=False):
|
if '\\u0000' not in json.dumps(obj, ensure_ascii=False):
|
||||||
return obj
|
return obj
|
||||||
except (TypeError, ValueError):
|
except (TypeError, ValueError):
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in new issue
Block a user