No need to re-serialize bytes (they're already serialized).
@@ -20,6 +20,8 @@ def either_encode_or_hash(obj: Any):
return obj.sha256.hex()
elif inspect.isfunction(obj):
return inspect.getsource(obj)
+ elif isinstance(obj, bytes):
+ return obj.hex()
raise TypeError(f"object of type {type(obj).__name__} not serializable")
