This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients exarkun, facundobatista, giampaolo.rodola, pitrou
Date 2010-09-07.19:50:10
SpamBayes Score 4.186212e-09
Marked as misclassified No
Message-id <1283889014.5.0.630828935384.issue9792@psf.upfronthosting.co.za>
In-reply-to
Content
When you call socket.create_connection() and it fails because it hits the socket timeout, the socket.timeout error is recast as a generic socket.error, which makes analyzing the failure more difficult (also, it means the "errno" attribute is lost for other types of errors):

>>> socket.setdefaulttimeout(0.000001)
>>> s = socket.socket()
>>> s.connect(("www.yahoo.fr", 80))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
socket.timeout: timed out
>>> socket.create_connection(("www.yahoo.fr", 80))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/antoine/py3k/__svn__/Lib/socket.py", line 319, in create_connection
    raise err
socket.error: timed out
History
Date User Action Args
2010-09-07 19:50:14pitrousetrecipients: + pitrou, facundobatista, exarkun, giampaolo.rodola
2010-09-07 19:50:14pitrousetmessageid: <1283889014.5.0.630828935384.issue9792@psf.upfronthosting.co.za>
2010-09-07 19:50:11pitroulinkissue9792 messages
2010-09-07 19:50:10pitroucreate