We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents bdab36b + aa3d5c1 commit 83853beCopy full SHA for 83853be
1 file changed
sendgrid/message.py
@@ -119,6 +119,8 @@ def set_replyto(self, replyto):
119
self.reply_to = replyto
120
121
def add_attachment(self, name, file_):
122
+ if sys.version_info < (3, 0) and isinstance(name, unicode):
123
+ name = name.encode('utf-8')
124
if isinstance(file_, str): # filepath
125
with open(file_, 'rb') as f:
126
self.files[name] = f.read()
0 commit comments