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.

classification
Title: test_asynchat fails on Mac OSX
Type: behavior Stage: resolved
Components: Tests Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: barry Nosy List: MrJean1, alanmcintyre, barry, benjamin.peterson, donmez, facundobatista, giampaolo.rodola, josiahcarlson, mark.dickinson, ned.deily, r.david.murray
Priority: release blocker Keywords: patch

Created on 2009-04-20 11:02 by donmez, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue5798_release26.patch mark.dickinson, 2010-08-04 13:43
Messages (40)
msg86193 - (view) Author: Ismail Donmez (donmez) * Date: 2009-04-20 11:02
Using latest python 2.6 branch; test_asynchat fails with the following
error:

error: uncaptured python exception, closing channel
<test.test_asynchat.echo_client at 0x1689238> (<class
'socket.error'>:[Errno 9] Bad file descriptor
[/Users/cartman/Sources/python-2.6/Lib/asyncore.py|readwrite|107]
[/Users/cartman/Sources/python-2.6/Lib/asyncore.py|handle_expt_event|441] [<string>|getsockopt|1]
[/Users/cartman/Sources/python-2.6/Lib/socket.py|_dummy|165])

Using Mac OSX 10.5.6.
msg86529 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-04-25 16:25
I'm seeing this failure on 2.7, 3.0 and 3.1 as well.
msg87368 - (view) Author: Ismail Donmez (donmez) * Date: 2009-05-07 11:42
Still fails in 3.1 beta1.
msg87371 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-05-07 12:09
I tried to track this down, but ran out of time.  Here's
the little that I discovered;  maybe someone else with
access to OS X (which I have) and an understanding of
poll (which I lack) can build on this.

The failure has to do with select.poll differences between Linux
and OS X.  It seems that OS X can return POLLIN | POLLPRI | POLLHUP
in situations where Linux just returns POLLIN, and this combination
of flags causes the code in asyncore to first close the socket and
then try to read from it.  The relevant code is at around line 440
of Lib/asyncore.py.
msg87375 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-05-07 16:50
r56632 looks relevant:

"""When running asynchat tests on OS X (darwin), the test client now
overrides asyncore.dispatcher.handle_expt to do nothing, since
select.poll gives a POLLHUP error at the completion of these tests.
Added timeout & count arguments to several asyncore.loop calls to
avoid the possibility of a test hanging up a build. [GSoC - Alan
McIntyre]"""

Adding Facundo Batista and Alan McIntyre to the nosy list.  Does either of 
you know what's going on with this issue?
msg87377 - (view) Author: Jean Brouwers (MrJean1) Date: 2009-05-07 17:01
Here is a (new?) failure of test_asynchat with Python 3.1b1 on MacOS X 
10.4.11 (Intel).

% make test
....
test test_asynchat produced unexpected output:
**********************************************************************
*** lines 2-16 of actual output doesn't appear in expected output after 
line 1:
+ error: uncaptured python exception, closing channel 
<test.test_asynchat.echo_client at 0x21dcc30> (<class 'socket.error'
>:[Errno 9] Bad file descriptor [../Python-
3.1b1/Lib/asyncore.py|readwrite|106] [../Python-3
.1b1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel 
<test.test_asynchat.echo_client at 0x21dcb90> (<class 'socket.error'
>:[Errno 9] Bad file descriptor [../Python-
3.1b1/Lib/asyncore.py|readwrite|106] [../Python-3
.1b1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel 
<test.test_asynchat.echo_client at 0x21dcf90> (<class 'socket.error'
>:[Errno 9] Bad file descriptor [../Python-
3.1b1/Lib/asyncore.py|readwrite|106] [../Python-3
.1b1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel 
<test.test_asynchat.echo_client at 0x21dcd50> (<class 'socket.error'
>:[Errno 9] Bad file descriptor [../Python-
3.1b1/Lib/asyncore.py|readwrite|106] [../Python-3
.1b1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel 
<test.test_asynchat.echo_client at 0x21dcc30> (<class 'socket.error'
>:[Errno 9] Bad file descriptor [../Python-
3.1b1/Lib/asyncore.py|readwrite|106] [../Python-3
.1b1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel 
<test.test_asynchat.echo_client at 0x21dcb90> (<class 'socket.error'
>:[Errno 9] Bad file descriptor [../Python-
3.1b1/Lib/asyncore.py|readwrite|106] [../Python-3
.1b1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel 
<test.test_asynchat.echo_client at 0x21dcf90> (<class 'socket.error'
>:[Errno 9] Bad file descriptor [../Python-
3.1b1/Lib/asyncore.py|readwrite|106] [../Python-3
.1b1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel 
<test.test_asynchat.echo_client at 0x21dcd50> (<class 'socket.error'
>:[Errno 9] Bad file descriptor [../Python-
3.1b1/Lib/asyncore.py|readwrite|106] [../Python-3
.1b1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel 
<test.test_asynchat.echo_client at 0x21dcc30> (<class 'socket.error'
>:[Errno 9] Bad file descriptor [../Python-
3.1b1/Lib/asyncore.py|readwrite|106] [../Python-3
.1b1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel 
<test.test_asynchat.echo_client at 0x21dcb90> (<class 'socket.error'
>:[Errno 9] Bad file descriptor [../Python-
3.1b1/Lib/asyncore.py|readwrite|106] [../Python-3
.1b1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel 
<test.test_asynchat.echo_client at 0x21dc2d0> (<class 'socket.error'
>:[Errno 9] Bad file descriptor [../Python-
3.1b1/Lib/asyncore.py|readwrite|106] [../Python-3
.1b1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel 
<test.test_asynchat.echo_client at 0x21dcc30> (<class 'socket.error'
>:[Errno 9] Bad file descriptor [../Python-
3.1b1/Lib/asyncore.py|readwrite|106] [../Python-3
.1b1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel 
<test.test_asynchat.echo_client at 0x21dcbb0> (<class 'socket.error'
>:[Errno 9] Bad file descriptor [../Python-
3.1b1/Lib/asyncore.py|readwrite|106] [../Python-3
.1b1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel 
<test.test_asynchat.echo_client at 0x21dcb90> (<class 'socket.error'
>:[Errno 9] Bad file descriptor [../Python-
3.1b1/Lib/asyncore.py|readwrite|106] [../Python-3
.1b1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel 
<test.test_asynchat.echo_client at 0x21dcd50> (<class 'socket.error'
>:[Errno 9] Bad file descriptor [../Python-
3.1b1/Lib/asyncore.py|readwrite|106] [../Python-3
.1b1/Lib/asyncore.py|handle_expt_event|440])
**********************************************************************
....

% ./python.exe Lib/test/test_asynchat.py
test_close_when_done (__main__.TestAsynchat) ... ok
test_empty_line (__main__.TestAsynchat) ... ok
test_line_terminator1 (__main__.TestAsynchat) ... ok
test_line_terminator2 (__main__.TestAsynchat) ... ok
test_line_terminator3 (__main__.TestAsynchat) ... ok
test_none_terminator (__main__.TestAsynchat) ... ok
test_numeric_terminator1 (__main__.TestAsynchat) ... ok
test_numeric_terminator2 (__main__.TestAsynchat) ... ok
test_simple_producer (__main__.TestAsynchat) ... ok
test_string_producer (__main__.TestAsynchat) ... ok
test_close_when_done (__main__.TestAsynchat_WithPoll) ... ok
test_empty_line (__main__.TestAsynchat_WithPoll) ... error: uncaptured 
python exception, closing channel <__main__.echo_client at 0x107cf30> 
(<class 'socket.error'>:[Errno 9] Bad file descriptor [../Python-
3.1b1/Lib/asyncore.py|readwrite|106] [../Python-
3.1b1/Lib/asyncore.py|handle_expt_event|440])
ok
test_line_terminator1 (__main__.TestAsynchat_WithPoll) ... error: 
uncaptured python exception, closing channel <__main__.echo_client at 
0x107c3f0> (<class 'socket.error'>:[Errno 9] Bad file descriptor 
[../Python-3.1b1/Lib/asyncore.py|readwrite|106] [../Python-
3.1b1/Lib/asyncore.py|handle_expt_event|440])
error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x107ceb0> (<class 'socket.error'>:[Errno 9] 
Bad file descriptor [../Python-3.1b1/Lib/asyncore.py|readwrite|106] 
[../Python-3.1b1/Lib/asyncore.py|handle_expt_event|440])
error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x107cf50> (<class 'socket.error'>:[Errno 9] 
Bad file descriptor [../Python-3.1b1/Lib/asyncore.py|readwrite|106] 
[../Python-3.1b1/Lib/asyncore.py|handle_expt_event|440])
ok
test_line_terminator2 (__main__.TestAsynchat_WithPoll) ... error: 
uncaptured python exception, closing channel <__main__.echo_client at 
0x107ce70> (<class 'socket.error'>:[Errno 9] Bad file descriptor 
[../Python-3.1b1/Lib/asyncore.py|readwrite|106] [../Python-
3.1b1/Lib/asyncore.py|handle_expt_event|440])
error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x107ced0> (<class 'socket.error'>:[Errno 9] 
Bad file descriptor [../Python-3.1b1/Lib/asyncore.py|readwrite|106] 
[../Python-3.1b1/Lib/asyncore.py|handle_expt_event|440])
error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x107cf30> (<class 'socket.error'>:[Errno 9] 
Bad file descriptor [../Python-3.1b1/Lib/asyncore.py|readwrite|106] 
[../Python-3.1b1/Lib/asyncore.py|handle_expt_event|440])
ok
test_line_terminator3 (__main__.TestAsynchat_WithPoll) ... error: 
uncaptured python exception, closing channel <__main__.echo_client at 
0x107ceb0> (<class 'socket.error'>:[Errno 9] Bad file descriptor 
[../Python-3.1b1/Lib/asyncore.py|readwrite|106] [../Python-
3.1b1/Lib/asyncore.py|handle_expt_event|440])
error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x107cf50> (<class 'socket.error'>:[Errno 9] 
Bad file descriptor [../Python-3.1b1/Lib/asyncore.py|readwrite|106] 
[../Python-3.1b1/Lib/asyncore.py|handle_expt_event|440])
error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x107cef0> (<class 'socket.error'>:[Errno 9] 
Bad file descriptor [../Python-3.1b1/Lib/asyncore.py|readwrite|106] 
[../Python-3.1b1/Lib/asyncore.py|handle_expt_event|440])
ok
test_none_terminator (__main__.TestAsynchat_WithPoll) ... error: 
uncaptured python exception, closing channel <__main__.echo_client at 
0x107cf50> (<class 'socket.error'>:[Errno 9] Bad file descriptor 
[../Python-3.1b1/Lib/asyncore.py|readwrite|106] [../Python-
3.1b1/Lib/asyncore.py|handle_expt_event|440])
ok
test_numeric_terminator1 (__main__.TestAsynchat_WithPoll) ... error: 
uncaptured python exception, closing channel <__main__.echo_client at 
0x107ce10> (<class 'socket.error'>:[Errno 9] Bad file descriptor 
[../Python-3.1b1/Lib/asyncore.py|readwrite|106] [../Python-
3.1b1/Lib/asyncore.py|handle_expt_event|440])
ok
test_numeric_terminator2 (__main__.TestAsynchat_WithPoll) ... error: 
uncaptured python exception, closing channel <__main__.echo_client at 
0x107ce50> (<class 'socket.error'>:[Errno 9] Bad file descriptor 
[../Python-3.1b1/Lib/asyncore.py|readwrite|106] [../Python-
3.1b1/Lib/asyncore.py|handle_expt_event|440])
ok
test_simple_producer (__main__.TestAsynchat_WithPoll) ... error: 
uncaptured python exception, closing channel <__main__.echo_client at 
0x107cdb0> (<class 'socket.error'>:[Errno 9] Bad file descriptor 
[../Python-3.1b1/Lib/asyncore.py|readwrite|106] [../Python-
3.1b1/Lib/asyncore.py|handle_expt_event|440])
ok
test_string_producer (__main__.TestAsynchat_WithPoll) ... error: 
uncaptured python exception, closing channel <__main__.echo_client at 
0x107cf50> (<class 'socket.error'>:[Errno 9] Bad file descriptor 
[../Python-3.1b1/Lib/asyncore.py|readwrite|106] [../Python-
3.1b1/Lib/asyncore.py|handle_expt_event|440])
ok
test_find_prefix_at_end (__main__.TestHelperFunctions) ... ok
test_basic (__main__.TestFifo) ... ok
test_given_list (__main__.TestFifo) ... ok

----------------------------------------------------------------------
Ran 23 tests in 7.712s

OK
msg87379 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-05-07 17:27
See also issue 1161031, especially Giampaolo's suggestion near the end.
 Seems like it might be relevant.  I was the one who merged Josiah's
trunk fix into othe other branches, to get things back into sync, but I
don't claim to understand the code at any deep level.  From the review I
did at my level of knowledge it seems like the change to the behavior of
when handle_expt_event is called is correct, but I was a little worried
about backward compatibility.  I now wonder if that fix should be backed
out of 2.6 and 3.0, and advertised in What's New for 2.7 and 3.1.
msg87386 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2009-05-07 18:30
Looking at trunk, it seems like one reasonable option is to swap the 
order of handle_close() and handle_expt_event() testing and calls.  That 
would keep all reading/writing before handle_close(), which should be 
correct.
msg87392 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-05-07 19:10
Josiah, that solution isn't working for me;  it looks as though there's 
a deeper weirdness:  what I'm seeing is that on OS X, in e.g. 
test_emptyline, we end up calling the readwrite function in asyncore.py 
with flags = POLLIN | POLLPRI | POLLHUP.  The first thing that gets 
called is obj.handle.read_event, and bizarrely it seems to be the 
read_event call that has the effect of closing the socket.  So the 
socket's already closed by the time we get to obj.handle_expt_event and 
the same error as before occurs.

I'm still trying to figure out why.
msg87393 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-05-07 19:28
So the sequence of events seems to be:
  asyncore.readwrite calls obj.handle_read_event
  ... which calls obj.handle_read (3rd branch of handle_read_event)
  ... which is defined in asynchat.py;  it calls obj.recv
  ... (back in asyncore now): recv calls obj.socket.recv
  ... and gets no data, so it then calls obj.handle_close
  ... which calls obj.close(), and so closes obj.socket as well.

and now obj.handle_expt_event gets confused because the socket is 
closed.

Now what?
msg87400 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2009-05-07 19:52
It would seem that we need to be more defensive in our calls.  We need 
to check to make sure that the socket isn't closed before calling 
read/write/expt events.
msg87402 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2009-05-07 20:03
Mark, try this:

        if flags & select.POLLIN and (obj.connected or obj.accepting):
            obj.handle_read_event()
        if flags & select.POLLOUT and obj.connected:
            obj.handle_write_event()
        if flags & select.POLLPRI and obj.connected:
            obj.handle_expt_event()
        if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL):
            obj.handle_close()
msg87403 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-05-07 20:10
That fixes test_empty_line (in test_asynchat.py), but now I get a hang in 
test_close_when_done.

By the way, here's an interesting site that goes some way to explaining 
what to expect from select.poll and EOF.

http://www.greenend.org.uk/rjk/2001/06/poll.html
msg87404 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2009-05-07 20:15
Try getting rid of the "and" clause in the select.POLLIN .
msg87405 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2009-05-07 20:18
To be clear, make the first test read...
        if flags & select.POLLIN:
            obj.handle_read_event()
msg87406 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-05-07 20:30
Getting rid of the and ... on the handle_read_event didn't make a 
difference:  I still get the hang in test_close_when_done.

But if I get rid of the and clause on the handle_write_event branch then
all the test_asynchat tests pass.  So that block now looks like:

        if flags & select.POLLIN and (obj.connected or obj.accepting):
            obj.handle_read_event()
        if flags & select.POLLOUT:
            obj.handle_write_event()
        if flags & select.POLLPRI and obj.connected:
            obj.handle_expt_event()
        if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL):
            obj.handle_close()

in my code.  So we're making progress (maybe). Unfortunately, 
test_asyncore now fails with:

======================================================================
FAIL: test_readwrite (__main__.HelperFunctionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_asyncore.py", line 161, in test_readwrite
    self.assertEqual(getattr(tobj, attr), attr==expectedattr)
AssertionError: False != True
msg87408 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2009-05-07 21:20
I went ahead and plugged my mac in (which reminded me of why I unplugged 
it in the first place), and I'm able to reproduce your error in the test 
after my proposed modifications.

One thing to remember is that the test is broken; we rely on a 
.connected attribute, which the test objects lack.

The attached patch fixes the test on my OS X machine, which you should 
test.
msg87416 - (view) Author: Jean Brouwers (MrJean1) Date: 2009-05-08 00:11
I reran the test_synchat.py test after patching to the Lib/asyncore.py 
and Lib/test/test-asynchat.py files of Python-3.1b1 on MacOS X 10.4.11 
(Intel).

The test now hangs in
...
test_string_producer (__main__.TestAsynchat) ... ok
test_close_when_done (__main__.TestAsynchat_WithPoll) ...

The test also hangs, after removing the patches from the 
Lib/test/test_asynchat.py file but keeping the patched Lib/asyncore.py 
file.
msg87417 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2009-05-08 00:18
As an aside, I was testing against trunk, not 3.1b1 .
msg87419 - (view) Author: Jean Brouwers (MrJean1) Date: 2009-05-08 00:40
Understood.

On Thu, May 7, 2009 at 5:18 PM, Josiah Carlson <report@bugs.python.org>wrote:

>
> Josiah Carlson <josiahcarlson@users.sourceforge.net> added the comment:
>
> As an aside, I was testing against trunk, not 3.1b1 .
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue5798>
> _______________________________________
>
msg87444 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2009-05-08 15:15
Has anyone already tried to modify readwrite() as I was suggesting here?
http://bugs.python.org/issue1161031#msg84892
msg87447 - (view) Author: Jean Brouwers (MrJean1) Date: 2009-05-08 16:18
Indeed, the unmodified test_asynchat.py now passes in Python 3.1b1.  The 
readwrite function in asyncore looks like this now:

def readwrite(obj, flags):
    try:
        if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL):
            obj.handle_close()
        else:
            if flags & select.POLLIN:
                obj.handle_read_event()
            if flags & select.POLLOUT:  # and obj.connected:
                obj.handle_write_event()
            if flags & select.POLLPRI:  # and obj.connected:
                obj.handle_expt_event()
    except _reraised_exceptions:
        raise
    except:
        obj.handle_error()
msg87453 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2009-05-08 17:49
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?
msg87455 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-05-08 18:24
With Josiah's patch, on trunk (r72475), test_asyncore passes, but
test_asynchat is still hanging in the test:

test_close_when_done (__main__.TestAsynchat_WithPoll) ... 

The hang occurs at the line "data = conn.recv(1)" in the run method
of the echo_server class in Lib/test/test_asynchat.py.
msg87458 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-05-08 18:53
With Giampaolo's suggested change, all tests pass.  My understanding of 
what asyncore/asynchat is intended to do and how it might be used in 
practice is weak, so I don't feel qualified to comment on the 
correctness of the change.

> 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.

Is it possible to add a test for this sort of situation, to make sure 
that future changes take it into account?
msg87465 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2009-05-08 19:38
Ok, so I was running "test_asyncore" and not "test_asynchat".

The issue on OS X is that when a new socket is connecting, select.poll() 
shows the socket as being writable when it first connects, but using my 
variant, .connected is False while it's waiting for the connection.

Options:
If we swap the pollin/pollout conditions, that would fix the hang on 
mac, but cause the hang on others (I'm not really worried about not 
doing a write after a read, .push() in asynchat performs an immediate 
send).

If we get rid of the .connected check, then when a .read() fails and 
causes a close, then we get an exception in handle_write().

If we swap to Giampaolo's variant, then we could lose data that was 
legitimately sent by a client.

I've got a version that doesn't hang on OS X, and should work on all 
platforms.  It's ugly, but it works.
msg87467 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-05-08 20:06
asyncore_fix_mac_2.patch fixes all test_failures for me, on both trunk and 
py3k.
msg87470 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2009-05-08 20:57
Here's an option that doesn't use .connected, which some people have 
expressed distaste for.

def readwrite(obj, flags):
    try:
        if flags & select.POLLIN:
            obj.handle_read_event()
        if flags & select.POLLOUT:
            obj.handle_write_event()
        if flags & select.POLLPRI:
            obj.handle_expt_event()
        if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL):
            obj.handle_close()
    except socket.error, e:
        if e.args[0] not in (EBADF, ECONNRESET, ENOTCONN, ESHUTDOWN, 
ECONNABORTED):
            obj.handle_error()
        else:
            obj.handle_close()
    except _reraised_exceptions:
        raise
    except:
        obj.handle_error()

It works on OS X and should work just as well on other platforms.
msg87477 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2009-05-08 22:20
Even if that patch would fix this issue (and I'm pretty sure it does) I
don't think it's a good idea handling all those errors (EBADF,
ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED) in readwrite() function.

Although those error codes unmistakably remark a disconnect event
condition (EBADF too? are we sure it *always* means that?) I would
prefer that be done in asyncore.dispatcher() and handle_close() be
called from there.

That's the implementation asyncore has always used until now where the
poller logic (poll(), poll2()) has always been kept separated from the
connection logic (asyncore.dispatcher) where the "if socket.err[0] in
..." stuff is done.


Unfortunately I haven't got an OS X box to test against and verify by
myself, but If I'm not mistaken by looking at the traceback messages
pasted by other folks, it seems that the exception takes place in
handle_expt_event() at this point:

err = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)

If that's the case I think it makes more sense catching EBADF from there
rather than breaking the logic used so far, also because, if I'm not
mistaken, the problem has been introduced by this very line which has
been added in Python 2.6.
msg88798 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2009-06-03 07:41
Still happening on 3.1rc1.

Should this be considered a release blocker for 3.1?
msg88813 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2009-06-03 15:03
If it's failing, and asyncore is still in 3.1, then I would argue yes.

I'll submit a fix to trunk and 3.1 based on my version below (unless 
anyone has any outstanding concerns, or believes that it doesn't work for 
them).
msg88822 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2009-06-03 19:49
Fixed in trunk in 73182, fixed in py3k in 73183.

Closing as fixed.
msg88855 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2009-06-04 00:06
Verified test_asynchat no longer fails in trunk nor py3k.  Thanks!
msg88888 - (view) Author: Jean Brouwers (MrJean1) Date: 2009-06-04 17:08
Well, with fresh build of Python 3.1rc1 on MacOS X 10.4.11 Tiger (Intel) test_asynchat.py rev 73183 still seems to 
fail, perhaps differently.  Here is 3 different results.  First, rev 73183:

% ./python.exe  Lib/test/test_asynchat73183.py
test_close_when_done (__main__.TestAsynchat) ... ok
test_empty_line (__main__.TestAsynchat) ... ok
test_line_terminator1 (__main__.TestAsynchat) ... ok
test_line_terminator2 (__main__.TestAsynchat) ... ok
test_line_terminator3 (__main__.TestAsynchat) ... ok
test_none_terminator (__main__.TestAsynchat) ... ok
test_numeric_terminator1 (__main__.TestAsynchat) ... ok
test_numeric_terminator2 (__main__.TestAsynchat) ... ok
test_simple_producer (__main__.TestAsynchat) ... ok
test_string_producer (__main__.TestAsynchat) ... ok
test_close_when_done (__main__.TestAsynchat_WithPoll) ... ok
test_empty_line (__main__.TestAsynchat_WithPoll) ... error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x10835b0> (<class 'socket.error'>:[Errno 9] Bad file descriptor [../Python-
3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-3.1rc1/Lib/asyncore.py|handle_expt_event|440])
ok
test_line_terminator1 (__main__.TestAsynchat_WithPoll) ... error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x1083550> (<class 'socket.error'>:[Errno 9] Bad file descriptor [../Python-
3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-3.1rc1/Lib/asyncore.py|handle_expt_event|440])
error: uncaptured python exception, closing channel <__main__.echo_client at 0x1083610> (<class 
'socket.error'>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
error: uncaptured python exception, closing channel <__main__.echo_client at 0x10835f0> (<class 
'socket.error'>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
ok
test_line_terminator2 (__main__.TestAsynchat_WithPoll) ... error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x1083630> (<class 'socket.error'>:[Errno 9] Bad file descriptor [../Python-
3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-3.1rc1/Lib/asyncore.py|handle_expt_event|440])
error: uncaptured python exception, closing channel <__main__.echo_client at 0x1083870> (<class 
'socket.error'>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
error: uncaptured python exception, closing channel <__main__.echo_client at 0x10838b0> (<class 
'socket.error'>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
ok
test_line_terminator3 (__main__.TestAsynchat_WithPoll) ... error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x1083610> (<class 'socket.error'>:[Errno 9] Bad file descriptor [../Python-
3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-3.1rc1/Lib/asyncore.py|handle_expt_event|440])
error: uncaptured python exception, closing channel <__main__.echo_client at 0x1083550> (<class 
'socket.error'>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
error: uncaptured python exception, closing channel <__main__.echo_client at 0x10835f0> (<class 
'socket.error'>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
ok
test_none_terminator (__main__.TestAsynchat_WithPoll) ... error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x1083550> (<class 'socket.error'>:[Errno 9] Bad file descriptor [../Python-
3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-3.1rc1/Lib/asyncore.py|handle_expt_event|440])
ok
test_numeric_terminator1 (__main__.TestAsynchat_WithPoll) ... error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x1083630> (<class 'socket.error'>:[Errno 9] Bad file descriptor [../Python-
3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-3.1rc1/Lib/asyncore.py|handle_expt_event|440])
ok
test_numeric_terminator2 (__main__.TestAsynchat_WithPoll) ... error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x10837f0> (<class 'socket.error'>:[Errno 9] Bad file descriptor [../Python-
3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-3.1rc1/Lib/asyncore.py|handle_expt_event|440])
ok
test_simple_producer (__main__.TestAsynchat_WithPoll) ... error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x1083910> (<class 'socket.error'>:[Errno 9] Bad file descriptor [../Python-
3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-3.1rc1/Lib/asyncore.py|handle_expt_event|440])
ok
test_string_producer (__main__.TestAsynchat_WithPoll) ... error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x10835b0> (<class 'socket.error'>:[Errno 9] Bad file descriptor [../Python-
3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-3.1rc1/Lib/asyncore.py|handle_expt_event|440])
ok
test_find_prefix_at_end (__main__.TestHelperFunctions) ... ok
test_basic (__main__.TestFifo) ... ok
test_given_list (__main__.TestFifo) ... ok

----------------------------------------------------------------------
Ran 23 tests in 7.717s

OK


Second, this is the result of test_asyncat.py included in Python 3.1rc1:

% ./python.exe Lib/test/test_asynchat.py
test_close_when_done (__main__.TestAsynchat) ... ok
test_empty_line (__main__.TestAsynchat) ... ok
test_line_terminator1 (__main__.TestAsynchat) ... ok
test_line_terminator2 (__main__.TestAsynchat) ... ok
test_line_terminator3 (__main__.TestAsynchat) ... ok
test_none_terminator (__main__.TestAsynchat) ... ok
test_numeric_terminator1 (__main__.TestAsynchat) ... ok
test_numeric_terminator2 (__main__.TestAsynchat) ... ok
test_simple_producer (__main__.TestAsynchat) ... ok
test_string_producer (__main__.TestAsynchat) ... ok
test_close_when_done (__main__.TestAsynchat_WithPoll) ... ok
test_empty_line (__main__.TestAsynchat_WithPoll) ... error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x10835b0> (<class 'socket.error'>:[Errno 9] Bad file descriptor [../Python-
3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-3.1rc1/Lib/asyncore.py|handle_expt_event|440])
ok
test_line_terminator1 (__main__.TestAsynchat_WithPoll) ... error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x1083550> (<class 'socket.error'>:[Errno 9] Bad file descriptor [../Python-
3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-3.1rc1/Lib/asyncore.py|handle_expt_event|440])
error: uncaptured python exception, closing channel <__main__.echo_client at 0x1083610> (<class 
'socket.error'>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
error: uncaptured python exception, closing channel <__main__.echo_client at 0x10835f0> (<class 
'socket.error'>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
ok
test_line_terminator2 (__main__.TestAsynchat_WithPoll) ... error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x1083630> (<class 'socket.error'>:[Errno 9] Bad file descriptor [../Python-
3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-3.1rc1/Lib/asyncore.py|handle_expt_event|440])
error: uncaptured python exception, closing channel <__main__.echo_client at 0x1083870> (<class 
'socket.error'>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
error: uncaptured python exception, closing channel <__main__.echo_client at 0x10838b0> (<class 
'socket.error'>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
ok
test_line_terminator3 (__main__.TestAsynchat_WithPoll) ... error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x1083610> (<class 'socket.error'>:[Errno 9] Bad file descriptor [../Python-
3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-3.1rc1/Lib/asyncore.py|handle_expt_event|440])
error: uncaptured python exception, closing channel <__main__.echo_client at 0x1083550> (<class 
'socket.error'>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
error: uncaptured python exception, closing channel <__main__.echo_client at 0x10835f0> (<class 
'socket.error'>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
ok
test_none_terminator (__main__.TestAsynchat_WithPoll) ... error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x1083550> (<class 'socket.error'>:[Errno 9] Bad file descriptor [../Python-
3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-3.1rc1/Lib/asyncore.py|handle_expt_event|440])
ok
test_numeric_terminator1 (__main__.TestAsynchat_WithPoll) ... error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x1083670> (<class 'socket.error'>:[Errno 9] Bad file descriptor [../Python-
3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-3.1rc1/Lib/asyncore.py|handle_expt_event|440])
ok
test_numeric_terminator2 (__main__.TestAsynchat_WithPoll) ... error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x10837f0> (<class 'socket.error'>:[Errno 9] Bad file descriptor [../Python-
3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-3.1rc1/Lib/asyncore.py|handle_expt_event|440])
ok
test_simple_producer (__main__.TestAsynchat_WithPoll) ... error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x1083910> (<class 'socket.error'>:[Errno 9] Bad file descriptor [../Python-
3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-3.1rc1/Lib/asyncore.py|handle_expt_event|440])
ok
test_string_producer (__main__.TestAsynchat_WithPoll) ... error: uncaptured python exception, closing channel 
<__main__.echo_client at 0x10835b0> (<class 'socket.error'>:[Errno 9] Bad file descriptor [../Python-
3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-3.1rc1/Lib/asyncore.py|handle_expt_event|440])
ok
test_find_prefix_at_end (__main__.TestHelperFunctions) ... ok
test_basic (__main__.TestFifo) ... ok
test_given_list (__main__.TestFifo) ... ok

----------------------------------------------------------------------
Ran 23 tests in 7.721s

OK


Both are not the exact same, but equivalent.  Lastly, here are 4 snippets from the 'make test' output.

....<deleted>....

test test_asynchat produced unexpected output:
**********************************************************************
*** lines 2-16 of actual output doesn't appear in expected output after line 1:
+ error: uncaptured python exception, closing channel <test.test_asynchat.echo_client at 0x22704f0> (<class 
'socket.error'
>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel <test.test_asynchat.echo_client at 0x2270b10> (<class 
'socket.error'
>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel <test.test_asynchat.echo_client at 0x22704b0> (<class 
'socket.error'
>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel <test.test_asynchat.echo_client at 0x2270470> (<class 
'socket.error'
>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel <test.test_asynchat.echo_client at 0x22703d0> (<class 
'socket.error'
>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel <test.test_asynchat.echo_client at 0x2270450> (<class 
'socket.error'
>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel <test.test_asynchat.echo_client at 0x22704f0> (<class 
'socket.error'
>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel <test.test_asynchat.echo_client at 0x22704b0> (<class 
'socket.error'
>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel <test.test_asynchat.echo_client at 0x2270b10> (<class 
'socket.error'
>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel <test.test_asynchat.echo_client at 0x2270530> (<class 
'socket.error'
>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel <test.test_asynchat.echo_client at 0x2270b10> (<class 
'socket.error'
>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel <test.test_asynchat.echo_client at 0x2270470> (<class 
'socket.error'
>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel <test.test_asynchat.echo_client at 0x22704d0> (<class 
'socket.error'
>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel <test.test_asynchat.echo_client at 0x22709f0> (<class 
'socket.error'
>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
+ error: uncaptured python exception, closing channel <test.test_asynchat.echo_client at 0x2270b10> (<class 
'socket.error'
>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [../Tools/Python-
3.1rc1/Lib/asyncore.py|handle_expt_event|440])
**********************************************************************
....<deleted>....

test_cmd_line
test test_cmd_line failed -- Traceback (most recent call last):
  File "../Tools/Python-3.1rc1/Lib/test/test_cmd_line.py", line 145, in test_run_code
    0)
AssertionError: 1 != 0
....<deleted>....

test test_smtplib produced unexpected output:
**********************************************************************
*** line 2 of actual output doesn't appear in expected output after line 1:
+ error: uncaptured python exception, closing channel <test.test_smtplib.SimSMTPChannel 127.0.0.1:50714 at 
0x3b21ff0> (<cl
ass 'socket.error'>:[Errno 9] Bad file descriptor [../Python-3.1rc1/Lib/asyncore.py|readwrite|106] [/Users/
../Python-3.1rc1/Lib/asyncore.py|handle_expt_event|440])
**********************************************************************
....<deleted>....

308 tests OK.
3 tests failed:
    test_asynchat test_cmd_line test_smtplib
25 tests skipped:
    test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp
    test_codecmaps_kr test_codecmaps_tw test_curses test_dbm_gnu
    test_epoll test_largefile test_nis test_normalization
    test_ossaudiodev test_pep277 test_smtpnet test_socketserver
    test_startfile test_timeout test_tk test_ttk_guionly
    test_urllib2net test_urllibnet test_winreg test_winsound
    test_xmlrpc_net test_zipfile64
Those skips are all expected on darwin.
make: *** [test] Error 1
msg88889 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-06-04 17:19
I presume you mean "a fresh build of 3.1rc1+" (from svn)?  3.1rc1 does
not contain the most recent fix.
msg88890 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2009-06-04 18:01
I installed 3.1rc1 on my OS X (10.5.?) machine, updated asynchat, and ran 
the test with and without my change.  Without my change, it breaks in the 
way described numerous times.  With my change, it seems to work fine on OS 
X, linux, and Windows for me.

Looking at line 106 in py3k/Lib/asyncore.py 
(http://svn.python.org/view/python/branches/py3k/Lib/asyncore.py?
annotate=73183) gets me "obj.handle_close()".  Your tracebacks show line 
106 calling "obj.handle_expt_event()", which is the old code.
msg88920 - (view) Author: Jean Brouwers (MrJean1) Date: 2009-06-05 04:18
Correct.  With new Lib/asyncore.py file rev 73183 all 23 tests in the 
original test_asynchat.py pass in Python 3.1rc1 built from source on 
MacOS X 10.4.11 Tiger (Intel).

% ./python.exe Lib/test/test_asynchat.py
test_close_when_done (__main__.TestAsynchat) ... ok
test_empty_line (__main__.TestAsynchat) ... ok
test_line_terminator1 (__main__.TestAsynchat) ... ok
test_line_terminator2 (__main__.TestAsynchat) ... ok
test_line_terminator3 (__main__.TestAsynchat) ... ok
test_none_terminator (__main__.TestAsynchat) ... ok
test_numeric_terminator1 (__main__.TestAsynchat) ... ok
test_numeric_terminator2 (__main__.TestAsynchat) ... ok
test_simple_producer (__main__.TestAsynchat) ... ok
test_string_producer (__main__.TestAsynchat) ... ok
test_close_when_done (__main__.TestAsynchat_WithPoll) ... ok
test_empty_line (__main__.TestAsynchat_WithPoll) ... ok
test_line_terminator1 (__main__.TestAsynchat_WithPoll) ... ok
test_line_terminator2 (__main__.TestAsynchat_WithPoll) ... ok
test_line_terminator3 (__main__.TestAsynchat_WithPoll) ... ok
test_none_terminator (__main__.TestAsynchat_WithPoll) ... ok
test_numeric_terminator1 (__main__.TestAsynchat_WithPoll) ... ok
test_numeric_terminator2 (__main__.TestAsynchat_WithPoll) ... ok
test_simple_producer (__main__.TestAsynchat_WithPoll) ... ok
test_string_producer (__main__.TestAsynchat_WithPoll) ... ok
test_find_prefix_at_end (__main__.TestHelperFunctions) ... ok
test_basic (__main__.TestFifo) ... ok
test_given_list (__main__.TestFifo) ... ok

----------------------------------------------------------------------
Ran 23 tests in 7.726s

OK
msg112809 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-08-04 13:43
Josiah's fix in r73182 applies cleanly to the release26-maint branch, and fixes (for me, at least) the current OS X failures in test_asynchat and test_smtplib.  I've attached a patch with the backport of this fix, and a Misc/NEWS entry.

Barry, can this go in before 2.6.6 final?
msg112811 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2010-08-04 14:30
Thanks Mark, go ahead and apply this, then close this issue.
msg112813 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-08-04 14:42
Applied in r83718.
History
Date User Action Args
2022-04-11 14:56:48adminsetgithub: 50048
2010-08-04 14:43:18mark.dickinsonsetresolution: accepted -> fixed
stage: needs patch -> resolved
2010-08-04 14:42:53mark.dickinsonsetstatus: open -> closed

messages: + msg112813
2010-08-04 14:30:31barrysetresolution: accepted
messages: + msg112811
2010-08-04 13:43:08mark.dickinsonsetstatus: closed -> open
files: + issue5798_release26.patch

assignee: barry
versions: - Python 3.0, Python 3.1, Python 2.7
nosy: + barry

messages: + msg112809
resolution: fixed -> (no value)
2009-06-05 04:19:00MrJean1setmessages: + msg88920
2009-06-04 18:01:50josiahcarlsonsetmessages: + msg88890
2009-06-04 17:19:18r.david.murraysetmessages: + msg88889
2009-06-04 17:08:10MrJean1setmessages: + msg88888
2009-06-04 00:06:08ned.deilysetmessages: + msg88855
2009-06-03 19:49:29josiahcarlsonsetstatus: open -> closed
resolution: fixed
messages: + msg88822
2009-06-03 19:49:05josiahcarlsonsetfiles: - asyncore_fix_mac_2.patch
2009-06-03 16:55:47benjamin.petersonsetpriority: high -> release blocker
2009-06-03 15:03:09josiahcarlsonsetmessages: + msg88813
2009-06-03 07:41:37ned.deilysetnosy: + benjamin.peterson, ned.deily
messages: + msg88798
2009-05-08 22:20:04giampaolo.rodolasetmessages: + msg87477
2009-05-08 20:57:49josiahcarlsonsetmessages: + msg87470
2009-05-08 20:06:33mark.dickinsonsetmessages: + msg87467
2009-05-08 19:39:31josiahcarlsonsetfiles: - unnamed
2009-05-08 19:38:56josiahcarlsonsetfiles: - asyncore_fix_mac.patch
2009-05-08 19:38:45josiahcarlsonsetfiles: + asyncore_fix_mac_2.patch

messages: + msg87465
2009-05-08 18:53:36mark.dickinsonsetmessages: + msg87458
2009-05-08 18:24:08mark.dickinsonsetmessages: + msg87455
2009-05-08 17:49:31josiahcarlsonsetmessages: + msg87453
2009-05-08 16:18:46MrJean1setmessages: + msg87447
2009-05-08 15:15:00giampaolo.rodolasetmessages: + msg87444
2009-05-08 00:40:31MrJean1setfiles: + unnamed

messages: + msg87419
2009-05-08 00:18:44josiahcarlsonsetmessages: + msg87417
2009-05-08 00:11:36MrJean1setmessages: + msg87416
2009-05-07 21:20:05josiahcarlsonsetfiles: + asyncore_fix_mac.patch
keywords: + patch
messages: + msg87408
2009-05-07 20:30:15mark.dickinsonsetmessages: + msg87406
2009-05-07 20:18:05josiahcarlsonsetmessages: + msg87405
2009-05-07 20:15:02josiahcarlsonsetmessages: + msg87404
2009-05-07 20:10:52mark.dickinsonsetmessages: + msg87403
2009-05-07 20:03:02josiahcarlsonsetmessages: + msg87402
2009-05-07 19:52:44josiahcarlsonsetmessages: + msg87400
2009-05-07 19:28:06mark.dickinsonsetmessages: + msg87393
2009-05-07 19:10:09mark.dickinsonsetmessages: + msg87392
2009-05-07 18:30:05josiahcarlsonsetmessages: + msg87386
2009-05-07 17:27:43r.david.murraysetnosy: + r.david.murray, josiahcarlson, giampaolo.rodola
messages: + msg87379

type: behavior
stage: needs patch
2009-05-07 17:01:33MrJean1setnosy: + MrJean1
messages: + msg87377
2009-05-07 16:50:28mark.dickinsonsetnosy: + facundobatista, alanmcintyre
messages: + msg87375
2009-05-07 12:09:44mark.dickinsonsetmessages: + msg87371
2009-05-07 11:42:45donmezsetmessages: + msg87368
2009-04-25 16:25:34mark.dickinsonsetpriority: high
versions: + Python 3.0, Python 3.1, Python 2.7
nosy: + mark.dickinson

messages: + msg86529
2009-04-20 11:02:11donmezcreate