Fix async invocation in Python 3
See
@@ -187,7 +187,7 @@ class LambdaAsyncResponse:
Given a message, directly invoke the lamdba function for this task.
"""
message["command"] = "zappa.asynchronous.route_lambda_task"
- payload = json.dumps(message).encode("utf-8")
+ payload = json.dumps(message)
if len(payload) > LAMBDA_ASYNC_PAYLOAD_LIMIT: # pragma: no cover
raise AsyncException("Payload too large for async Lambda call")
self.response = self.client.invoke(
@@ -259,7 +259,7 @@ class SnsAsyncResponse(LambdaAsyncResponse):
Given a message, publish to this topic.
"""
message["command"] = "zappa.asynchronous.route_sns_task"
- payload = json.dumps(message).encode("utf-8")
+ payload = json.dumps(message)
if len(payload) > LAMBDA_ASYNC_PAYLOAD_LIMIT: # pragma: no cover
raise AsyncException("Payload too large for SNS")
self.response = self.client.publish(TargetArn=self.arn, Message=payload)
