Skip to content

Commit

Permalink
adding a Python3 fix to JsonRPC serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
cloud-rocket committed Oct 4, 2021
1 parent 99a90e4 commit 42cd02d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion aio_pika/patterns/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,8 @@ class JsonRPC(RPC):
CONTENT_TYPE = "application/json"

def serialize(self, data: Any) -> bytes:
return self.SERIALIZER.dumps(data, ensure_ascii=False, default=repr)
return self.SERIALIZER.dumps(
data, ensure_ascii=False, default=repr).encode('ascii')

def serialize_exception(self, exception: Exception) -> bytes:
return self.serialize(
Expand Down

0 comments on commit 42cd02d

Please sign in to comment.