You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JSON standard requires double quotes for strings and single quotes are disallowed. However, python tends to output certain values with single quotes. For example:
>>>a= ["hello"]
>>>print(a)
['hello']
>>>importjson>>>json.loads(a)
Traceback (mostrecentcalllast):
File"<stdin>", line1, in<module>File"/usr/lib/python3.12/json/__init__.py", line339, inloadsraiseTypeError(f'the JSON object must be str, bytes or bytearray, 'TypeError: theJSONobjectmustbestr, bytesorbytearray, notlist>>>json.loads('["hello"]') # needs to be double quoted
['hello']
There is a unit test that depends on this behavior; it tries to take the python stringified output into the read_json() standard library function. However, the command section will output ['key1', 'key2'], which uses single quotes, meaning this is not valid JSON and failing the unit test.
The text was updated successfully, but these errors were encountered:
The JSON standard requires double quotes for strings and single quotes are disallowed. However, python tends to output certain values with single quotes. For example:
There is a unit test that depends on this behavior; it tries to take the python stringified output into the
read_json()
standard library function. However, the command section will output['key1', 'key2']
, which uses single quotes, meaning this is not valid JSON and failing the unit test.The text was updated successfully, but these errors were encountered: