TypeError: wrap_socket() missing 1 required positional argument: 'sock'
See original GitHub issueI am getting this error since the release of 0.9.5
. This happens on Python 2.7, 3.4, 3.5 and 3.6.
Here’s the stack-trace:
Traceback (most recent call last):
File "/home/travis/build/GetStream/stream-django/.eggs/httpretty-0.9.5-py3.6.egg/httpretty/core.py", line 1636, in wrapper
return test(*args, **kw)
File "/home/travis/build/GetStream/stream-django/stream_django/tests/test_app/tests/test_manager.py", line 48, in test_unfollow_user
feed_manager.unfollow_user(1, 2)
File "/home/travis/build/GetStream/stream-django/stream_django/managers.py", line 49, in unfollow_user
feed.unfollow(target_feed.slug, target_feed.user_id)
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/stream/feed.py", line 166, in unfollow
response = self.client.delete(url, signature=token, params=params)
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/stream/client.py", line 271, in delete
return self._make_request(self.session.delete, *args, **kwargs)
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/stream/client.py", line 210, in _make_request
params=default_params, timeout=self.timeout)
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/requests/sessions.py", line 591, in delete
return self.request('DELETE', url, **kwargs)
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/requests/sessions.py", line 512, in request
resp = self.send(prep, **send_kwargs)
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/requests/sessions.py", line 622, in send
r = adapter.send(request, **kwargs)
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/requests/adapters.py", line 445, in send
timeout=timeout
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 343, in _make_request
self._validate_conn(conn)
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 849, in _validate_conn
conn.connect()
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/urllib3/connection.py", line 356, in connect
ssl_context=context)
File "/home/travis/build/GetStream/stream-django/.eggs/httpretty-0.9.5-py3.6.egg/httpretty/core.py", line 600, in fake_wrap_socket
return orig_wrap_socket_fn(*args, **kw)
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 359, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/home/travis/build/GetStream/stream-django/.eggs/httpretty-0.9.5-py3.6.egg/httpretty/core.py", line 600, in fake_wrap_socket
return orig_wrap_socket_fn(*args, **kw)
TypeError: wrap_socket() missing 1 required positional argument: 'sock'
This is happening on a public Github project during Travis (https://travis-ci.org/GetStream/stream-django/builds).
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:12
Top Results From Across the Web
wrap_socket() missing 1 required positional argument: 'sock'
I am getting this error since the release of 0.9.5 . This happens on Python 2.7, 3.4, 3.5 and 3.6. Here's the stack-trace:...
Read more >TypeError: brodcast() missing 1 required positional argument ...
I'm creating a simple chat server and I keep getting this error. Traceback (most recent call last): File "C:\Users\OneDrive\Desktop\Py Files\ ...
Read more >wrap_socket() missing 1 required positional argument: 'sock'
We have a "Blender Farm" with a master and a few slaves. Now we try to use SSL. I configured the path of...
Read more >python - Problem using NetworkRender and SSL
I think I found the solution by myself. There are missing argumets in the python-script netrender/master.py.
Read more >Release Notes — HTTPretty 1.1.4 documentation
Fix TypeError: wrap_socket() missing 1 required positional argument: 'sock' (#393). Merge pull request #364. Merge pull request #371.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any progress?
I stumbled on this error as well. It happens in this method:
Checking around, I found out that the problem comes from line 1491:
ssl.SSLContext.wrap_socket
is a class method and has aself
param that partial ignores completely. It should usefunctools.partialmethod
and apply the instancessl.SSLContext
properly around. As it is, the call on line 600 is attributing the fake sock and causing the error. I tried fixing this way. Sock missing was solved. BUT, the lib got stuck. It didn’t break, nor answered a thing.So, there must be something more here.