FS#52458 - [pypy3] fails to import ssl module because of openssl "no-ssl3-method"
Attached to Project:
Community Packages
Opened by Daniel Hahler (blueyed) - Monday, 09 January 2017, 17:03 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Saturday, 25 March 2017, 14:53 GMT
Opened by Daniel Hahler (blueyed) - Monday, 09 January 2017, 17:03 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Saturday, 25 March 2017, 14:53 GMT
|
Details
Description:
Openssl is built with `no-ssl3-method` (https://git.archlinux.org/svntogit/packages.git/tree/openssl/trunk/PKGBUILD?id=698241593a2bb7289633227562f7b513647e9433), which causes an error when importing `ssl` in pypy3. Upstream bug report: https://bitbucket.org/pypy/pypy/issues/2315/failed-to-import-ssl-if-openssl-is-built Given the staleness of the upstream issue I think a patch for Arch's package might make sense, since it seems to be uncommon to build openssl with `no-ssl3-method`? The patch could then be sent upstream, of course. Additional info: * 5.5.0-1 Steps to reproduce: % pypy3 -c 'import ssl' Traceback (most recent call last): File "<string>", line 1, in <module> File "/opt/pypy3/lib-python/3/ssl.py", line 94, in <module> from _ssl import (PROTOCOL_SSLv3, PROTOCOL_SSLv23, ImportError: cannot import name 'PROTOCOL_SSLv3' This causes e.g. pip to fail: > pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. |
This task depends upon
Closed by Sven-Hendrik Haase (Svenstaro)
Saturday, 25 March 2017, 14:53 GMT
Reason for closing: Fixed
Saturday, 25 March 2017, 14:53 GMT
Reason for closing: Fixed
> ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?
@yan12125
Your PKGBUILD works, thanks!
btw: it should be twice as fast to use `pypy` for building, instead of `python2`.
FYI: pyenv uses prebuilt binaries [1] so the issue should be reported to pyenv
> btw: it should be twice as fast to use `pypy` for building, instead of `python2`.
I use python2 as I believe almost everyone already has python2 while much fewer people have pypy. I've disowned that AUR package for a long time. Feel free to adopt and update it!
[1] https://github.com/yyuu/pyenv/blob/master/plugins/python-build/share/python-build/pypy3.3-5.2-alpha1
Yes, the issue with pyenv shows that it is really an upstream issue.
But also that it's caused by Arch's (progressive) openssl configuration.
Also, it's just a makedepends.
> I've disowned that AUR package for a long time. Feel free to adopt and update it!
Thanks for the offer.
Not sure if I will do it, but what would be the process?
$ pypy3
Python 3.5.3 (b16a4363e930f6401bceb499b9520955504c6cb0, Mar 22 2017, 08:59:27)
[PyPy 5.7.0-beta0 with GCC 6.3.1 20170306] on linux
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``the way to avoid a workaround is
to introduce a stronger workaround somewhere else''
>>>> import urllib.request
>>>> req = urllib.request.urlopen('https://httpbin.org/ip')
>>>> import json
>>>> json.loads(req.read().decode())
{'origin': '(my IP)'}