We use AWS boto SNS publishing to publish our push notifications.
pub_result = self.conn.publish(message=message_json,target_arn=device_arn,message_structure='json')
if the message text contains emoji, we get an exception: line 490, in add_auth \ n qs = self.query_string (req) \ n File "/usr/local/lib/python2.7/dist-packages/boto/auth.py" , line 332, in query_string \ n pval = str (http_request.params [pname]). encode (\ 'utf-8 \') \ nUnicodeDecodeError: \ 'ascii \' codec cannot decode byte 0xf0 at position 48: serial number is not in the range (128) \ n ',' error ': u "' ascii 'codec cannot decode byte 0xf0 at position 48: serial number is not in the range (128) "}
A possible solution is to change:
https://github.com/boto/boto/blob/develop/boto/auth.py
line 333: replace:
val = str(http_request.params[pname]).encode('utf-8')
with:
val = unicode(http_request.params[pname]).encode('utf-8')
source
share