When passing a dict as an attachment to Connection.send(), there is no check whether the content value is a unicode or binary value. If a binary value is passed, the following exception is raised:
File "connection.py", line 80, in send
'attachments': list(self._process_attachments(attachments)),
...
File "/usr/lib/python3.5/json/encoder.py", line 180, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: b'...' is not JSON serializable
The correct behavior would be for Connection._process_attachments() to detect this, encode the value with base64, and set encoded to True in the JSON payload to Hectane.
When passing a
dictas an attachment toConnection.send(), there is no check whether thecontentvalue is a unicode or binary value. If a binary value is passed, the following exception is raised:The correct behavior would be for
Connection._process_attachments()to detect this, encode the value with base64, and setencodedtoTruein the JSON payload to Hectane.