[issue5798] test_asynchat fails on Mac OSX
Josiah Carlson
report at bugs.python.org
Fri May 8 19:49:32 CEST 2009
Josiah Carlson <josiahcarlson at users.sourceforge.net> added the comment:
One of the issues with using the method that Giampaolo describes, which
I explained to him, is that generally if someone sends you data, you
want to receive it. You can get both data and the signal that someone
disconnected, in particular, with asynchat's .close_when_done() method.
If you get a read signal, generally you want to try to pull more data
before you close, because when you close, you can never get any pending
data again.
For example, if I were to use:
chat.send("commit\n")
chat.close_when_done()
It's very likely that on even moderate latency network connections
(10ms), the other end would get the close signal at the same time as the
read for the "commit\n" message. But since they close before they read,
they never get the "commit" message, and maybe a transaction is
reverted.
My primary concern is keeping the library correct. Adding attributes in
the test cases don't bother me.
Jean: on what platform are you experiencing the hang? Are you using
trunk or 3.1?
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5798>
_______________________________________
More information about the Python-bugs-list
mailing list