Skip to content
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

request() got an unexpected keyword argument 'encode_chunked' on Python 3.6 #4

Open
LaurensBosscher opened this issue Jan 29, 2018 · 1 comment

Comments

@LaurensBosscher
Copy link

test_1       |   File "/usr/local/lib/python3.6/site-packages/suds/client.py", line 115, in __init__
test_1       |     self.wsdl = reader.open(url)
test_1       |   File "/usr/local/lib/python3.6/site-packages/suds/reader.py", line 150, in open
test_1       |     d = self.fn(url, self.options)
test_1       |   File "/usr/local/lib/python3.6/site-packages/suds/wsdl.py", line 136, in __init__
test_1       |     d = reader.open(url)
test_1       |   File "/usr/local/lib/python3.6/site-packages/suds/reader.py", line 74, in open
test_1       |     d = self.download(url)
test_1       |   File "/usr/local/lib/python3.6/site-packages/suds/reader.py", line 92, in download
test_1       |     fp = self.options.transport.open(Request(url))
test_1       |   File "/usr/local/lib/python3.6/site-packages/suds/transport/https.py", line 62, in open
test_1       |     return HttpTransport.open(self, request)
test_1       |   File "/usr/local/lib/python3.6/site-packages/suds/transport/http.py", line 67, in open
test_1       |     return self.u2open(u2request)
test_1       |   File "/usr/local/lib/python3.6/site-packages/suds/transport/http.py", line 132, in u2open
test_1       |     return url.open(u2request, timeout=tm)
test_1       |   File "/usr/local/lib/python3.6/urllib/request.py", line 526, in open
test_1       |     response = self._open(req, data)
test_1       |   File "/usr/local/lib/python3.6/urllib/request.py", line 544, in _open
test_1       |     '_open', req)
test_1       |   File "/usr/local/lib/python3.6/urllib/request.py", line 504, in _call_chain
test_1       |     result = func(*args)
test_1       |   File "/usr/local/lib/python3.6/urllib/request.py", line 1361, in https_open
test_1       |     context=self._context, check_hostname=self._check_hostname)
test_1       |   File "/usr/local/lib/python3.6/urllib/request.py", line 1318, in do_open
test_1       |     encode_chunked=req.has_header('Transfer-encoding'))
test_1       | TypeError: request() got an unexpected keyword argument 'encode_chunked'

In Python 3.6 http.client.HTTPConnection.request, a new keyword argument of encode_chunked was added. Currently, it doesn't look like suds-jurko does not support this change so you get a stacktrace.
https://docs.python.org/3.6/library/http.client.html#http.client.HTTPConnection.request

I'm not sure but it seems that modifying https://github.com/andersinno/suds-jurko/blob/44e27560b328ec6482459ea2d75516849dc209ff/suds/transport/__init__.py to accept *args and **kwargs should be enough.

@LaurensBosscher
Copy link
Author

This issue can be closed, this was not a suds-jurko error but a vcrpy issue, see: kevin1024/vcrpy#293

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant