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
When VCR patches HTTPConnection with vcr.patch.VCRHTTPSConnection, it does not accept this new keyword argument and so you see the following stacktrace for example:
File "/usr/local/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/lib/python3.6/urllib/request.py", line 526, in open
response = self._open(req, data)
File "/usr/local/lib/python3.6/urllib/request.py", line 544, in _open
'_open', req)
File "/usr/local/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.6/urllib/request.py", line 1361, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/usr/local/lib/python3.6/urllib/request.py", line 1318, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
TypeError: request() got an unexpected keyword argument 'encode_chunked'
In the do_open method of /usr/local/lib/python3.6/urllib/request.py, a http_class class is expected. VCR passes in the class vcr.patch.VCRHTTPSConnection (an instance of VCRConnection) for this.
In do_open, Python calls http_class(...).request(..., encode_chunked). Since VCR uses VCRHTTPSConnection here, VCRHTTPSConnection.request(). This method (https://github.com/kevin1024/vcrpy/blob/master/vcr/stubs/__init__.py#L156) does not accept the encode_chunked keyword and so we get TypeError: request() got an unexpected keyword argument 'encode_chunked'.
The text was updated successfully, but these errors were encountered:
* Add Python 3.6 to CI
* Workaround for kevin1024/vcrpy#293
- Do not run pylint on 3.6 as pylint doesn’t support 3.6 yet
- Add Python 3.6 to package classifiers
In Python 3.6 http.client.HTTPConnection.request, a new keyword argument of
encode_chunked
was added. Currently, it doesn't look like VCR does not support this change so you get a stacktrace.https://docs.python.org/3.6/library/http.client.html#http.client.HTTPConnection.request
When VCR patches
HTTPConnection
withvcr.patch.VCRHTTPSConnection
, it does not accept this new keyword argument and so you see the following stacktrace for example:Similar to: boto/botocore#1079 where the solution was in PR boto/botocore#1107 (accept the kwargs but don't use them).
More info:
In the
do_open
method of/usr/local/lib/python3.6/urllib/request.py
, ahttp_class
class is expected. VCR passes in the classvcr.patch.VCRHTTPSConnection
(an instance ofVCRConnection
) for this.In
do_open
, Python callshttp_class(...).request(..., encode_chunked)
. Since VCR usesVCRHTTPSConnection
here,VCRHTTPSConnection.request()
. This method (https://github.com/kevin1024/vcrpy/blob/master/vcr/stubs/__init__.py#L156) does not accept theencode_chunked
keyword and so we getTypeError: request() got an unexpected keyword argument 'encode_chunked'
.The text was updated successfully, but these errors were encountered: