Page MenuHomePhabricator

script_tests.py is facing lots of failiures in python 2.6: AssertionError: u'deprecated' unexpectedly found
Closed, ResolvedPublic

Description

https://travis-ci.org/wikimedia/pywikibot-core/jobs/259248647#L6498

======================================================================

FAIL: test_wikisourcetext (tests.script_tests.TestScriptSimulate)

Test running wikisourcetext -simulate.

----------------------------------------------------------------------

Traceback (most recent call last):

  File "/home/travis/build/wikimedia/pywikibot-core/tests/script_tests.py", line 328, in testScript

    self.assertNotIn('deprecated', result['stderr'].lower())

AssertionError: u'deprecated' unexpectedly found in u'/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/urllib3/contrib/pyopenssl.py:46: deprecationwarning: openssl.rand is deprecated - you should use os.urandom instead\n  import openssl.ssl\nerror: missing parameter(s) "-index"\nuse -help for further information.\n'

Event Timeline

pyopenssl has deprecated rand in version 17.2.0 (2017-07-20).[1]

Also it's going to be removed in the next version (it's removed in their dev branch but not released yet).[2]

I still don't know which module is calling rand.

[1]: https://github.com/pyca/pyopenssl/pull/658
[2]: https://github.com/pyca/pyopenssl/pull/675

Another upstream issue...

The fix will be released in version 17.3.0 of pyopenssl.

[[ https://github.com/pyca/pyopenssl/commit/8a1de8d6cb5656f335b49fa9f4159f82f51e374a | They had deprecated rand module in 17.2.0 ]], but hadn't removed one of their own imports in the OpenSSL/__init__.py. This inevitably causes a deprecation warning and the failure in our test.

Change 368746 had a related patch set uploaded (by Dalba; owner: Dalba):
[pywikibot/core@master] requirements.txt: Avoid pyOpenSSL 17.2.0

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

Change 368746 merged by jenkins-bot:
[pywikibot/core@master] requirements.txt: Avoid pyOpenSSL 17.2.0

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