JSON serializer for artifacts that handles bytes
(self, obj)
| 2420 | return len(str(value).encode("utf-8")) |
| 2421 | |
| 2422 | def _artifact_serializer(self, obj): |
| 2423 | """JSON serializer for artifacts that handles bytes""" |
| 2424 | if isinstance(obj, bytes): |
| 2425 | return {"__bytes__": base64.b64encode(obj).decode("utf-8")} |
| 2426 | raise TypeError(f"Object of type {type(obj)} is not JSON serializable") |
| 2427 | |
| 2428 | def _artifact_deserializer(self, dct): |
| 2429 | """JSON deserializer for artifacts that handles bytes""" |
nothing calls this directly
no outgoing calls
no test coverage detected