Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SendGrid 1.4.3 broken in Python 3, introduce via iteritems #126

Closed
urda opened this issue Sep 25, 2015 · 2 comments
Closed

SendGrid 1.4.3 broken in Python 3, introduce via iteritems #126

urda opened this issue Sep 25, 2015 · 2 comments

Comments

@urda
Copy link

urda commented Sep 25, 2015

Problem

sendgrid 1.4.3 is broken when used in a python3 context. A call is being made to iteritems during the set_headers call.

This iteritems call was introduced in commit afe99dc

Workaround

Python 3 users should not upgrade to 1.4.3 and remain at 1.4.2

Testing Environment

Bash Commands

# Environment setup
$ mkvirtualenv --python=/usr/bin/python3 sendgrid-issue

$ python --version
Python 3.4.3

# Upgrade pip, install sendgrid
$ pip install -U pip
$ pip install sendgrid
Collecting sendgrid
  Using cached sendgrid-1.4.3.tar.gz
Collecting smtpapi==0.2.0 (from sendgrid)
  Downloading smtpapi-0.2.0.tar.gz
Installing collected packages: smtpapi, sendgrid
  Running setup.py install for smtpapi
  Running setup.py install for sendgrid
Successfully installed sendgrid-1.4.3 smtpapi-0.2.0

# Confirm pip status
$ pip freeze
sendgrid==1.4.3
smtpapi==0.2.0

# Begin in next code section
$ python

Python sample

>>> import sendgrid
>>> message = sendgrid.Mail()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/purda/.virtualenvs/sendgrid-issue/lib/python3.4/site-packages/sendgrid/message.py", line 50, in __init__
    self.set_headers(opts.get('headers', {}))
  File "/home/purda/.virtualenvs/sendgrid-issue/lib/python3.4/site-packages/sendgrid/message.py", line 168, in set_headers
    for key, value in headers.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'
urda referenced this issue Sep 25, 2015
- Reply To header now supports friendly name [#110](#110)
@thinkingserious
Copy link
Contributor

This is fixed in this pull request: #128

Thanks!

@urda
Copy link
Author

urda commented Sep 29, 2015

:bowtie: Aw yeah :shipit: !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants