Message31865
select.select fails on file-like objects created by socket.makefile when data exists in the file buffer but not in the underlying socket.
Here is code to reproduce the bug. Run it, then point a web browser at port 8080 and observer that select times out indicating that no input is available even though input is still in fact available.
=======
from SocketServer import *
from socket import *
from select import select
class myHandler(StreamRequestHandler):
def handle(self):
while 1:
sl = select([self.rfile],[],[],1)[0]
print sl
l = self.rfile.readline()
if len(l)<3: break
print l,
pass
print>>self.wfile, 'HTTP/1.0 200 OK'
print>>self.wfile, 'Content-type: text/plain'
print>>self.wfile
print>>self.wfile, 'foo'
server = TCPServer(('',8080), myHandler)
server.serve_forever()
|
|
Date |
User |
Action |
Args |
2007-08-23 14:53:17 | admin | link | issue1705393 messages |
2007-08-23 14:53:17 | admin | create | |
|