[issue9641] httplib/ftplib: timeout parameter not applied correctly

2010-08-21 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue9641] httplib/ftplib: timeout parameter not applied correctly

2010-08-19 Thread Anders Sandvig
Anders Sandvig added the comment: socket.create_connection() does in fact set the timeout of the resulting socket object, so the issue is not an issue after all. The problems I experienced was a result of sending the timeout as the third parameter to the HTTPConnection() constructor instead o

[issue9641] httplib/ftplib: timeout parameter not applied correctly

2010-08-19 Thread Anders Sandvig
Anders Sandvig added the comment: The best (and simplest) solution seems to be option 2). Affected methods are found to be HTTPConnection.connect() and HTTPSConnection.connect() in Lib/httplib.py (Lib/http/client.py for 3.x) and FTP.connect() and FTP.ntransfercmd() in Lib/ftplib.py. It appears

[issue9641] httplib/ftplib: timeout parameter not applied correctly

2010-08-19 Thread Anders Sandvig
New submission from Anders Sandvig : >From : Consider the following code for retreieving a web page using httplib: def get_url(hostname, port, url, timeout=5): con = httplib.HTTPConnection(hostname, port, timeout)