You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib2 import urlopen
>>> urlopen('https://google.ca')
<addinfourl at 140299620351008 whose fp = <socket._fileobject object at 0x7f9a0f352050>>
>>> _.read()[:100]
'<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="en-CA"><head><meta cont'
Great! But then this fails:
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import future.standard_library
>>> future.standard_library.install_aliases()
>>> from urllib.request import urlopen
>>> urlopen('https://google.ca')
(…)
future.backports.urllib.error.URLError: <urlopen error unknown url type: https>
>>> future.__version__
'0.15.2'
But 3 is fine too:
Python 3.4.0 (default, Jun 19 2015, 14:20:21)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib.request import urlopen
>>> urlopen('https://google.ca')
<http.client.HTTPResponse object at 0x7f5cdbb295c0>
>>> _.read()[:100]
b'<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="en-CA"><head><meta cont'
What's going on?
The text was updated successfully, but these errors were encountered:
We ran into a similar issue yesterday and I looked into it today. I'm not sure if there is something better than your workaround because the SSL library built into python 2.7.9 broke backward compatibility (for critical security reasons) which is what ends up causing the error.
In both python core and futures the http.client detects availability of SSL and HTTPS during module import, this is done through importing the ssl module. future also checks for SSLContext (the change introduced in 2.7.9 from backporting ssl from 3.x). If this can't be imported SSL is disabled and you can't make HTTPS connections.
It is conceivable that future could detect this and do some workaround to use the HTTPSConnection in pre-2.7.9 pythons, but I'm not sure that's worth it because of the security ramifications.
This works fine:
Great! But then this fails:
But 3 is fine too:
What's going on?
The text was updated successfully, but these errors were encountered: