Teodor Georgiev <[email protected]> added the comment:
Precisely, I traced down the problem by putting a simple "breakpoint"
in asyncore.py:
def poll(timeout=0.0, map=None):
if map is None:
map = socket_map
if map:
r = []; w = []; e = []
for fd, obj in map.items():
is_r = obj.readable()
print "Readable??? -->" , is_r
is_w = obj.writable()
if is_r:
r.append(fd)
if is_w:
w.append(fd)
if is_r or is_w:
e.append(fd)
if [] == r == w == e:
time.sleep(timeout)
return
print r,w,e
try:
r, w, e = select.select(r, w, e, timeout)
except select.error, err:
if err.args[0] != EINTR:
raise
else:
return
And here it comes:
[5] [5] [5]
Readable??? --> True
[5] [5] [5]
Readable??? --> True
[5] [5] [5]
Readable??? --> False
[] [5] [5]
Traceback (most recent call last):
File "./dlms_client.py", line 136, in <module>
asyncore.loop(timeout=0.8)
File "/usr/lib/python2.6/asyncore.py", line 213, in loop
poll_fun(timeout)
File "/usr/lib/python2.6/asyncore.py", line 146, in poll
raise
File "/usr/lib/python2.6/asyncore.py", line 143, in poll
r, w, e = select.select(r, w, e, timeout)
select.error: (9, 'Bad file descriptor')
So, in order this to work, on first sight all r,w,e must not point to
a socket that has been already closed. Now I am going to think for a workaround
at least.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue10878>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com