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 orsenthil
Recipients orsenthil, vstinner
Date 2010-04-19.19:08:48
SpamBayes Score 1.6329994e-05
Marked as misclassified No
Message-id <1271704130.37.0.390873332594.issue8460@psf.upfronthosting.co.za>
In-reply-to
Content
Hello Victor,

The patch looks for fine for a timeout enforcement.

A couple of changes required.

-                if isinstance(err[0], timeout):
+                if isinstance(err[0], socket.timeout):

And, in this portion:

+                try:
+                    with test_support.transient_internet():
+                        buf = f.read()
+                except socket.timeout:
+                    print >>sys.stderr, "<timeout: %s>" % url
                 f.close()
                 debug("read %d bytes" % len(buf))

The last line references, buf. It wont be available if a socket.timeout had happened. So, it can simply be moved to the line below buf = f.read(). Attaching the patch with these changes.

Question: Were you able to simulate a timeout at kernel.org site to test this? If yes, how? I am unable to simulate (by changing the kernel.org:81, kernel42.org etc), it immediately throws a connection refused. ( In general, I could simulate the timeout by urlopen('www.google.com:81', timeout=30) and test the exception) 

As build-bot seems to be hung, a timeout enforcement as the patch accomplishes is fine.
History
Date User Action Args
2010-04-19 19:08:50orsenthilsetrecipients: + orsenthil, vstinner
2010-04-19 19:08:50orsenthilsetmessageid: <1271704130.37.0.390873332594.issue8460@psf.upfronthosting.co.za>
2010-04-19 19:08:48orsenthillinkissue8460 messages
2010-04-19 19:08:48orsenthilcreate