Message103625
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. |
|
Date |
User |
Action |
Args |
2010-04-19 19:08:50 | orsenthil | set | recipients:
+ orsenthil, vstinner |
2010-04-19 19:08:50 | orsenthil | set | messageid: <1271704130.37.0.390873332594.issue8460@psf.upfronthosting.co.za> |
2010-04-19 19:08:48 | orsenthil | link | issue8460 messages |
2010-04-19 19:08:48 | orsenthil | create | |
|