Open mikeobr opened 4 years ago
I am not clear on this. Is this an issue with the handler code or do you suspect it being a MMS issue? The error suggests that its a handler issue. Error seems to be coming as a part of exception thrown by the handler Code here
I went through the #850, I think. I understand the issue a bit better now. This looks like a good solution as well. This should probably be picked up as a part of #845
Problem use case: Given an MMS custom service prints some input for logging purposes, when the service receives json with unicode characters, the service errors out.
Steps to reproduce"
Create a dummy MMS service with a handler like:
def handle(data, context): if data is None: return print(data[0]["body"]) return ["Finished successfully."]
Send requests with ascii characters and it succeeds, but with unicode the service returns an error.
Test script
Results
Workaround To work around this behavior, services need to override the sys.stdout encoding.
Reference to topic in different issue: https://github.com/awslabs/multi-model-server/issues/850#issuecomment-566678665