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 kristjan.jonsson
Recipients Justin.Cappos, bbangert, exarkun, giampaolo.rodola, kristjan.jonsson, loewis, ned.deily, nicdumz, pitrou, ronaldoussoren, rosslagerwall, roysmith
Date 2011-03-30.16:15:25
SpamBayes Score 9.948386e-08
Marked as misclassified No
Message-id <1301501725.99.0.227596474118.issue7995@psf.upfronthosting.co.za>
In-reply-to
Content
socket.defaulttimeout(None)
s = socket.socket()
s.settimeout(0) #nonblocking
s.bind()
s2, a = s.accept()
print s2.gettimeout() #prints ´none´, meaning blocking
s2.receive(10) #raises EWOULDBLOCK error, since internally it is non-blocking

I don't agree with practicality vs. purity, particularly when trying to understand the timeout logic.  Most of the timeout logic is implemented in c and never touched by python, in init_sockobject().  But then you tack on extra logic in socket.py, in what is even a socket object wrapper.  This means that any module that uses the "pure" _socket.socket object, such as C extensions, will not get the "correct" behaviour.
History
Date User Action Args
2011-03-30 16:15:26kristjan.jonssonsetrecipients: + kristjan.jonsson, loewis, ronaldoussoren, exarkun, roysmith, pitrou, giampaolo.rodola, ned.deily, nicdumz, bbangert, Justin.Cappos, rosslagerwall
2011-03-30 16:15:25kristjan.jonssonsetmessageid: <1301501725.99.0.227596474118.issue7995@psf.upfronthosting.co.za>
2011-03-30 16:15:25kristjan.jonssonlinkissue7995 messages
2011-03-30 16:15:25kristjan.jonssoncreate