Page MenuHomePhabricator

Cryptography is going to drop support for python 2.7.6 and before
Closed, ResolvedPublic

Description

https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst#23---2018-07-18:

Support for Python 2.7.x without hmac.compare_digest has been deprecated. We will require Python 2.7.7 or higher (or 2.7.6 on Ubuntu) in the next cryptography release.

We need to pin the cryptography version to 2.3 or less for those Python versions.

This has already caused multiple errors in our tests, all script tests are failing on 2.7_with_system_site_packages because of the deprecation warning:
https://travis-ci.org/wikimedia/pywikibot/jobs/405476506#L5572

======================================================================
FAIL: test_add_text (tests.script_tests.TestScriptHelp)
Test running add_text -help.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/wikimedia/pywikibot/tests/script_tests.py", line 288, in testScript
    stderr_other)
AssertionError: u'Use -help for further information.' not found in [u'/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.', u'  utils.DeprecatedIn23,', u'family and mylang are not set.', u"Defaulting to family='test' and mylang='test'."]

Event Timeline

Dalba triaged this task as High priority.Jul 19 2018, 2:48 AM

Change 447040 had a related patch set uploaded (by Dalba; owner: dalba):
[pywikibot/core@master] Require cryptography<2.3 for Python 2.7.7 or older

https://gerrit.wikimedia.org/r/447040

Change 447040 merged by jenkins-bot:
[pywikibot/core@master] Require cryptography<2.3 for Python 2.7.6 or older

https://gerrit.wikimedia.org/r/447040

I believe we should deprecate Python versions older than 2.7.6, too, but that is better left for another task.