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

SSLContext infinite recursion in Python 3.6 #903

Closed
juokaz opened this issue Dec 7, 2016 · 5 comments
Closed

SSLContext infinite recursion in Python 3.6 #903

juokaz opened this issue Dec 7, 2016 · 5 comments
Labels
PyVer: python3 Affects Python 3 Status: not gevent Environment or otherwise not a gevent issue. No further work expected.

Comments

@juokaz
Copy link

juokaz commented Dec 7, 2016

The issue is this method in python/ssl.py.

    @options.setter
    def options(self, value):
        super(SSLContext, SSLContext).options.__set__(self, value)

It fails when using for example requests library:

root@8042e3f57981:/app# python
Python 3.6.0b4 (default, Nov 23 2016, 21:34:29)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gevent.monkey
>>> gevent.monkey.patch_all()
>>>
>>> from requests.packages.urllib3.util.ssl_ import create_urllib3_context
>>> create_urllib3_context()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/requests/packages/urllib3/util/ssl_.py", line 268, in create_urllib3_context
    context.options |= options
  File "/usr/local/lib/python3.6/ssl.py", line 459, in options
    super(SSLContext, SSLContext).options.__set__(self, value)
  File "/usr/local/lib/python3.6/ssl.py", line 459, in options
    super(SSLContext, SSLContext).options.__set__(self, value)
  File "/usr/local/lib/python3.6/ssl.py", line 459, in options
    super(SSLContext, SSLContext).options.__set__(self, value)
  [Previous line repeated 329 more times]
RecursionError: maximum recursion depth exceeded while calling a Python object
>>>
@jamadden
Copy link
Member

jamadden commented Dec 8, 2016

I believe you're using gevent 1.1, yes? Please use gevent 1.2a1 or newer on Python 3.6.

@jamadden jamadden closed this as completed Dec 8, 2016
@juokaz
Copy link
Author

juokaz commented Dec 8, 2016

I tried running on 1.2a1 and it worked. My bad, thank you @jamadden!

@jamadden jamadden added Status: not gevent Environment or otherwise not a gevent issue. No further work expected. PyVer: python3 Affects Python 3 labels Dec 8, 2016
@pirate
Copy link

pirate commented Jan 19, 2017

Now that python3.6 is released, should we re-open this ticket until gevent >1.2 becomes default pip install? As it stands the "stable" 3.6 standard library with a default setup is not usable with https urls.

@jamadden
Copy link
Member

jamadden commented Jan 19, 2017

gevent 1.2 was released the same day as 3.6.

@pirate
Copy link

pirate commented Jan 19, 2017

Ah thanks @jamadden, it looks like I mistakenly thought pip install --upgrade requests would also bump gevent to the newer required version. Working for me now after pip install --upgrade gevent.

@gevent gevent locked and limited conversation to collaborators Jan 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
PyVer: python3 Affects Python 3 Status: not gevent Environment or otherwise not a gevent issue. No further work expected.
Projects
None yet
Development

No branches or pull requests

3 participants