Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
simplejson次のjson文字列をデコードするために使用しています。
simplejson
Pythonで書かれたデモは次のとおりです。
from simplejson import loads loads("""["\s"]""")
デコーダーは以下をスローします:
JSONDecodeError: Invalid \escape
これにどう対処するか?期待される出力は次のとおりです。
["\\s"]
「\s」は有効な JSON エスケープ文字列ではありません。
json.orgによると、次のエスケープのみが有効です