Well, regardless of the brokenness of the patch, I do get two
different failures from this test on OSX. The first is caused by
trying to socket.bind() a port that's already been bound recently:

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/Users/jyasskin/src/python/test_asyncore/Lib/threading.py",
line 464, in __bootstrap
    self.run()
  File "/Users/jyasskin/src/python/test_asyncore/Lib/threading.py",
line 444, in run
    self.__target(*self.__args, **self.__kwargs)
  File "Lib/test/test_asyncore.py", line 59, in capture_server
    serv.bind(("", PORT))
  File "<string>", line 1, in bind
socket.error: (48, 'Address already in use')

That looks pretty easy to fix.

The second:

======================================================================
ERROR: test_send (__main__.DispatcherWithSendTests_UsePoll)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_asyncore.py", line 351, in test_send
    d.send(data)
  File "/Users/jyasskin/src/python/test_asyncore/Lib/asyncore.py",
line 468, in send
    self.initiate_send()
  File "/Users/jyasskin/src/python/test_asyncore/Lib/asyncore.py",
line 455, in initiate_send
    num_sent = dispatcher.send(self, self.out_buffer[:512])
  File "/Users/jyasskin/src/python/test_asyncore/Lib/asyncore.py",
line 335, in send
    if why[0] == EWOULDBLOCK:
TypeError: 'error' object is unindexable

seems to be caused by a change in exceptions. I've reduced the problem
into the attached patch, which adds a test to Lib/test/test_socket.py.
It looks like subscripting is no longer the way to get values out of
socket.errors, but another way hasn't been implemented yet.

On 7/30/07, Greg Ewing <[EMAIL PROTECTED]> wrote:
> Hasan Diwan wrote:
> > The issue seems to be in the socket.py close method. It needs to sleep
> > socket.SO_REUSEADDR seconds before returning.
>
> WHAT??? socket.SO_REUSEADDR is a flag that you pass when
> creating a socket to tell it to re-use an existing address,
> not something to be used as a timeout value, as far as
> I know.
>
> --
> Greg
> _______________________________________________
> Python-3000 mailing list
> Python-3000@python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe: 
> http://mail.python.org/mailman/options/python-3000/jyasskin%40gmail.com
>


-- 
Namasté,
Jeffrey Yasskin
http://jeffrey.yasskin.info/

"Religion is an improper response to the Divine." — "Skinny Legs and
All", by Tom Robbins

Attachment: socket_breakage.diff
Description: Binary data

_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to