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 vstinner
Recipients vstinner
Date 2010-04-29.23:43:52
SpamBayes Score 8.271875e-05
Marked as misclassified No
Message-id <1272584635.55.0.748550054978.issue8574@psf.upfronthosting.co.za>
In-reply-to
Content
Many tests of the Python test suite depends on the availability of websites, especially www.python.org. Python.org has some troubles since some days, and many buildbots failed (test_robotparser failure).

I propose to use a default timeout of 60 seconds in transient_internet(), and then use transient_internet() in tests using the internet.

Patches:
 - transient_internet.py: set temporary the defalt socket timeout to 60 seconds (and then restore the previous default value), and catch also weird IOError (which contain in socket.error as the 2nd argument) from urllib
 - test_robotparser_transient_internet.py: use "with transient_internet():" to do not hung anymore (for 1800 seconds!) if a website is down

On Linux, you can use "iptables -I OUTPUT -p tcp --dport 80 -j DROP" (drop all outgoing packets) to simulate a network failure, and set the default timeout value of transient_internet() to 3 seconds.
History
Date User Action Args
2010-04-29 23:43:56vstinnersetrecipients: + vstinner
2010-04-29 23:43:55vstinnersetmessageid: <1272584635.55.0.748550054978.issue8574@psf.upfronthosting.co.za>
2010-04-29 23:43:53vstinnerlinkissue8574 messages
2010-04-29 23:43:53vstinnercreate