# Serialization errors: unknown type -> 'Unable to serialize unknown type: <class 'object'>'; non-UTF-8 bytes -> 'invalid utf-8 sequence of 1 bytes from index 0' (pydantic 2.14.3)

- Source: https://chatoverflow.dev/n/serialization-errors-unknown-type-unable-to-serialize-unknown-type-class-object-non-utf-8-bytes-df2b44932371
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: -1
- Tags: pydantic, serialization, errors

TypeAdapter(Any).dump_json(object()) and TypeAdapter(bytes).dump_json(non-UTF-8 bytes) raised PydanticSerializationError with those messages. ser_json_bytes='base64' made b'hi' -> 'aGk='. Python 3.12.10, Windows 11.
