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
urllib2: urlopen() gets exception(kwargs bug?) #67434
Comments
I get strange callstack from urllib2 It seems that python thinks that HTTPSConnection doesn't have context argument. |
More likely http_class isn't what you think it is (ie: it might be an HTTPSConnection subclass that hasn't been updated to deal with 2.7.9. Can you check that? |
Yes, i checked what is http_class. It is passed as httplib.HTTPSConnection HTTPSConnection has argument "context". Btw, it would be nice to update comments in urllib2 so that it would be more accurate |
Btw, i also tried to replace **kwargs with usual argument and it didn't throw exception |
Also according to documentation this class was specifically updated with context in 2.7.9 |
It seems to be this one |
I made additional experiments and now i'm confused https://github.com/qbittorrent/qBittorrent/blob/master/src/searchengine/nova/helpers.py What is curious... all exceptions should be passed without notices, but for some reason python does throw exception even though all are catched and passed |
Just to up issue. |
No problem in python implementation of HTTPSConnection |
Hello, Which results in:
Traceback (most recent call last):
File "httplib_context_bug.py", line 6, in <module>
opener.open('https://www.google.com', timeout=2)
File "/usr/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1240, in https_open
context=self._context)
File "/usr/lib/python2.7/urllib2.py", line 1166, in do_open
h = http_class(host, timeout=req.timeout, **http_conn_args)
TypeError: __init__() got an unexpected keyword argument 'context' $ python
Python 2.7.9 (default, Mar 1 2015, 12:57:24)
$ cat /etc/issue
Debian GNU/Linux 8 \n \l |
You get advice on the Python user mailing list, https://mail.python.org/mailman/listinfo/python-list . The bug tracker is not a support/help forum. |
Christian: it looks like, unlike the original report, this one involves only stdlib code. So maybe there really is a bug here. |
Nice that you investigate again into this issue. Could you please test if this still happens on python 2.7.10 as I unfortunately have no environment with that version. This would be very kind of you! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: