From 7c8f05a408ab960a7c3fbf302ed74781685911d9 Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Thu, 1 Sep 2016 11:33:27 -0700 Subject: [PATCH 1/2] Python 2/3 compatibility, naming consistency --- sendgrid/helpers/inbound/parse.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sendgrid/helpers/inbound/parse.py b/sendgrid/helpers/inbound/parse.py index ddd6ec2bb..b35f92d47 100644 --- a/sendgrid/helpers/inbound/parse.py +++ b/sendgrid/helpers/inbound/parse.py @@ -2,6 +2,7 @@ import base64 import email import mimetypes +from six import iteritems from werkzeug.utils import secure_filename @@ -47,7 +48,7 @@ def attachments(self): def _get_attachments(self, request): attachments = [] - for _, filestorage in request.files.iteritems(): + for _, filestorage in iteritems(request.files): attachment = {} if filestorage.filename not in (None, 'fdopen', ''): filename = secure_filename(filestorage.filename) @@ -72,7 +73,7 @@ def _get_attachments_raw(self, raw_email): filename = 'part-%03d%s' % (counter, ext) counter += 1 attachment['type'] = part.get_content_type() - attachment['filename'] = filename + attachment['file_name'] = filename attachment['contents'] = part.get_payload(decode=False) attachments.append(attachment) return attachments From 5095a8ecc4053ebf6313d51e0a81aa7f8248dbdc Mon Sep 17 00:00:00 2001 From: Elmer Thomas Date: Thu, 1 Sep 2016 11:39:18 -0700 Subject: [PATCH 2/2] Travis fix --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 3ea5dc4ce..e26db6932 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,7 @@ install: - python setup.py install - pip install pyyaml - pip install flask +- pip install six before_script: - mkdir prism - mkdir prism/bin