Skip to content

TypeError: Object of type datetime is not JSON serializable #144

Description

@pat-grammophones

i got this error on my raspiberri pi os light

TypeError: Object of type datetime is not JSON serializable

File "/home/paddy/.local/lib/python3.13/site-packages/aiohttp/web_response.py", line 848, in json_response
text = dumps(data)
File "/usr/lib/python3.13/json/init.py", line 231, in dumps
return _default_encoder.encode(obj)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^
File "/usr/lib/python3.13/json/encoder.py", line 200, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.13/json/encoder.py", line 261, in iterencode
return _iterencode(o, 0)
File "/usr/lib/python3.13/json/encoder.py", line 180, in default
raise TypeError(f'Object of type {o.class.name} '
f'is not JSON serializable')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions