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

Webhooks in mailgun backend only work with newest 2.7 pythons #41

Closed
sebbacon opened this issue Oct 31, 2016 · 2 comments
Closed

Webhooks in mailgun backend only work with newest 2.7 pythons #41

sebbacon opened this issue Oct 31, 2016 · 2 comments

Comments

@sebbacon
Copy link
Contributor

hmac.compare_digest is new in 2.7.7. Debian Wheezy, LTS supported until May 2018, is currently at 2.7.3.

As a consequence, trying to use Mailgun mailhooks on Wheezy fails.

I suppose the fix is something like this, along perhaps with a deprecation notice or similar?

sebbacon added a commit to sebbacon/django-anymail that referenced this issue Oct 31, 2016
@medmunds
Copy link
Contributor

Ah, thanks for the catch. This also affects Mandrill webhooks. Travis-CI is currently running Python 2.7.9 for Python 2.7 builds, so it doesn't catch this.

BTW, even once this is fixed in Anymail, there are some good reasons to run a newer Python 2.7 build, at least for your Django app. (For example, there's likely an urllib3 InsecurePlatformWarning lurking in your logs, where the call to Mailgun's https API can't be verified with the 2.7.3 urllib.) I've used the Deadsnakes PPA to upgrade Python 2.7 on older Ubuntu LTS builds; not sure what the equivalent is for Debian.

@sebbacon
Copy link
Contributor Author

sebbacon commented Nov 1, 2016

OK. FWIW I started looking at using tox + pyenv to support a matrix of minor versions in travis, but it all got a bit complicated and I ran out of time :)

Thanks for a great library BTW.

medmunds pushed a commit that referenced this issue Nov 1, 2016
Compatibility with Python 2.7 versions older than 2.7.7

* Use Django's constant_time_compare method
* Include sparkpost in test requirements
* Don't use non-public `EnvironmentVarGuard` in tests

Fixes #41
medmunds pushed a commit that referenced this issue Nov 1, 2016
Compatibility with Python 2.7 versions older than 2.7.7

* Use Django's constant_time_compare method
* Include sparkpost in test requirements
* Don't use non-public `EnvironmentVarGuard` in tests

Fixes #41

(cherry picked from commit f0589e3)
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

No branches or pull requests

2 participants