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
https:// does not work with Python 3.6 #3752
Comments
This sounds like this is a bug in the standard library, actually: it seems like they introduced an infinite recursion when setting options directly. @tiran? |
I can't reproduce the issue on my machine (Python from latest hg 3.6 branch)
|
I just had a try to reproduce it from the requests end; I can’t hit it on 3.6.0b4 or 3.6.0rc1: $ python
Python 3.6.0b4 (v3.6.0b4:18496abdb3d5, Nov 21 2016, 20:44:47)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> requests.get('https://github.com/kennethreitz/requests/issues/3752')
<Response [200]> $ python
Python 3.6.0rc1 (v3.6.0rc1:29a273eee9a5, Dec 6 2016, 16:24:13)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> requests.get('https://github.com/kennethreitz/requests/issues/3752')
<Response [200]> Could it be something that’s platform or URL-specific? (OS X 10.12.1, 16B2659, for my part) |
Requests works with Python 3.6.0 from hg, too:
|
Ok, so right now this looks like a "can't repro" situation. Might be worth looking at your install @juokaz, seems to be misbehaving a bit. |
After further debugging, I was able to reproduce it as a I'm guessing I'm going to have to take it to gevent folks to have a look? Thanks for looking into this, everyone.
|
Yup, this is a gevent issue. I'd assume gevent doesn't yet work with Python 3.6. |
The super() call looks weird but it's correct. It's the generic way to fetch the attribute descriptor of the parent class. It's a necessary evil to change a property in a subclass. Ask Google for "David Beazley subclass property" and it will show you the same, https://www.safaribooksonline.com/library/view/python-cookbook-3rd/9781449357337/ch08s08.html
The call |
Here's the reference to the gevent ticket for the same issue: gevent/gevent#903 |
@pirate that doesn't fix the issue for me. Any other ideas? The other thread is locked. |
@AeroNotix please don't use this issue or this project's tracker to discuss gevent problems. |
@pirate can you unlock that ticket, then? I'm still having the same issue on python 3.6 with upgraded versions of everything. |
Nope @AeroNotix , I'm not a contributor on either project, perhaps you can email/irc one of the people in the other thread directly? |
@Pirata This issue still exists with import requests
import gevent.monkey
gevent.monkey.patch_ssl()
requests.get("https://google.com") If I import |
Requests has some problems with gevent and monkey patching because it performs feature detection on the select module at import time. A future release will bring it up to date with a newer urllib3 that contains fixes for this problem, but in the meantime gevent's monkey patch should be applied before importing requests. |
But in questions is psf/requests#3752 Workaround includes two new entry points, talisker.gunicorn.gevent and talisker.gunicorn.eventlet, that ensure monkeypatching is done before requests is imported. In the procss, have refactored all entrypoint functions to be in __init__.py. This moves it all into one place, and helps avoiding early imports.
But in questions is psf/requests#3752 Workaround includes two new entry points, talisker.gunicorn.gevent and talisker.gunicorn.eventlet, that ensure monkeypatching is done before requests is imported. In the procss, have refactored all entrypoint functions to be in __init__.py. This moves it all into one place, and helps avoiding early imports.
But in questions is psf/requests#3752 Workaround includes two new entry points, talisker.gunicorn.gevent and talisker.gunicorn.eventlet, that ensure monkeypatching is done before requests is imported. In the procss, have refactored all entrypoint functions to be in __init__.py. This moves it all into one place, and helps avoiding early imports.
* Workaround async requests bug on py36 But in questions is psf/requests#3752 Workaround includes two new entry points, talisker.gunicorn.gevent and talisker.gunicorn.eventlet, that ensure monkeypatching is done before requests is imported. In the procss, have refactored all entrypoint functions to be in __init__.py. This moves it all into one place, and helps avoiding early imports. * Add docs for new workarounds * increase timeout in py36 tests, hopefully temporarily
@Lukasa are you referring to this release? |
When requesting a https:// url,
request
method falls into an infinite recursion.The issue is this method in
python/ssl.py
.The commit which introduced this line to python is this https://hg.python.org/cpython/rev/c32e9f9b00f7.
The actual error looks like this:
Tested using
python 3.6.0b4
.The text was updated successfully, but these errors were encountered: