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

sock.settimeout(timeout) throws exception because timeout is a tuple #155

Open
Stevecaboose opened this issue Apr 14, 2020 · 1 comment
Open

Comments

@Stevecaboose
Copy link

After calling:
response = client.get('/me')

An exception is thrown because socket.py can only accept an integer as its timeout. I have seen some examples that set the timeout in the request object using a tuple. Did something change to the socket file that only accepts timeouts as an integer and no longer a tuple?

After I changed it to use a single integer, instead of a tuple, everything worked.

File "C:\Users\steven\AppData\Local\Programs\Python\Python38\lib\socket.py", line 793, in create_connection
  sock.settimeout(timeout)
TypeError: an integer is required (got type tuple)
@jaylinski
Copy link
Contributor

Vimeo uses the requests lib, which accepts tuples and integers:

https://2.python-requests.org/en/master/user/advanced/#timeouts

Maybe try the latest version, which adds Python 3 compatibility.

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

2 participants