You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/warsaw'closed_at=<Date2010-08-04.14:42:53.443>created_at=<Date2009-04-20.11:02:11.341>labels= ['type-bug', 'tests', 'release-blocker']
title='test_asynchat fails on Mac OSX'updated_at=<Date2010-08-04.14:43:18.192>user='https://bugs.python.org/donmez'
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.
"""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?
MrJean1 commented on May 7, 2009
MrJean1mannequin
Mannequin
More actions
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'
See also bpo-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.
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.
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.
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?
josiahcarlson commented on May 7, 2009
josiahcarlsonmannequin
Mannequin
More actions
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.
Verified test_asynchat no longer fails in trunk nor py3k. Thanks!
MrJean1 commented on Jun 4, 2009
MrJean1mannequin
Mannequin
More actions
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_code0)
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
I presume you mean "a fresh build of 3.1rc1+" (from svn)? 3.1rc1 does
not contain the most recent fix.
josiahcarlson commented on Jun 4, 2009
josiahcarlsonmannequin
Mannequin
More actions
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.
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
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.
Activity
donmez commentedon Apr 20, 2009
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.
mdickinson commentedon Apr 25, 2009
I'm seeing this failure on 2.7, 3.0 and 3.1 as well.
donmez commentedon May 7, 2009
Still fails in 3.1 beta1.
mdickinson commentedon May 7, 2009
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.
mdickinson commentedon May 7, 2009
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?
MrJean1 commentedon May 7, 2009
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'
....
% ./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
bitdancer commentedon May 7, 2009
See also bpo-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.
josiahcarlson commentedon May 7, 2009
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.
mdickinson commentedon May 7, 2009
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.
mdickinson commentedon May 7, 2009
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?
josiahcarlson commentedon May 7, 2009
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.
josiahcarlson commentedon May 7, 2009
Mark, try this:
mdickinson commentedon May 7, 2009
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
18 remaining items
josiahcarlson commentedon Jun 3, 2009
Fixed in trunk in 73182, fixed in py3k in 73183.
Closing as fixed.
ned-deily commentedon Jun 4, 2009
Verified test_asynchat no longer fails in trunk nor py3k. Thanks!
MrJean1 commentedon Jun 4, 2009
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'
....<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
bitdancer commentedon Jun 4, 2009
I presume you mean "a fresh build of 3.1rc1+" (from svn)? 3.1rc1 does
not contain the most recent fix.
josiahcarlson commentedon Jun 4, 2009
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.
MrJean1 commentedon Jun 5, 2009
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
mdickinson commentedon Aug 4, 2010
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?
warsaw commentedon Aug 4, 2010
Thanks Mark, go ahead and apply this, then close this issue.
mdickinson commentedon Aug 4, 2010
Applied in r83718.