Changes by Julien Palard mandark@gmail.com:
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24486
___
___
Julien Palard added the comment:
OK, so, requests have a `timeout` and take it into account, and it solves my
problem.
Yet I don't understand one little thing:
With both requests `timeout` parameter set or unset, the exact same
http.client.py:_read_status call the same socket.readinto. With
Martin Panter added the comment:
I assume you meant _without_ an explicit timeout setting in Requests, you see a
recvfrom() system call, and _with_ an explicit timeout you see poll(). I guess
that would be because Requests is using a blocking socket in the first case,
and in the second case
Martin Panter added the comment:
The closest I have is Python 3.3, but this times out properly for me:
from http.client import HTTPConnection
import socket
socket.setdefaulttimeout(10)
h = HTTPConnection(192.168.1.84)
h.request(GET, /)
h.getresponse()
Traceback (most recent call last):
Julien Palard added the comment:
I only have a `socket.setdefaulttimeout(10)` just after my imports...
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24486
___
New submission from Julien Palard:
Requesting HTTP using `requests`, which uses `http.client` which use `socket`,
sometimes, my program get stuck like this:
```
File /usr/lib/python3.2/socket.py, line 287 in readinto
File /usr/lib/python3.2/http/client.py, line 308 in _read_status
File
Martin Panter added the comment:
You did not mention if the HTTP connection has a timeout set. If no timeout is
set, it will block until the server sends or closes the connection. The timeout
sets how long the socket spends “checking if data is available” before giving
up.
--
nosy: