This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author spaceone
Recipients Douman, alex, demian.brecht, r.david.murray, spaceone
Date 2016-09-26.14:28:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1474900118.53.0.787282835637.issue23245@psf.upfronthosting.co.za>
In-reply-to
Content
Hello,
The resolution of this bug is "not a bug". If that is the case can you please add information how to fix/workaround this.
I have got the following valid-seeming code:
"""
import cookielib
import urllib
import urllib2
cookie = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookie))
opener.open('https://www.google.com', timeout=2)
"""

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
History
Date User Action Args
2016-09-26 14:28:38spaceonesetrecipients: + spaceone, alex, r.david.murray, demian.brecht, Douman
2016-09-26 14:28:38spaceonesetmessageid: <1474900118.53.0.787282835637.issue23245@psf.upfronthosting.co.za>
2016-09-26 14:28:38spaceonelinkissue23245 messages
2016-09-26 14:28:38spaceonecreate