[Patches] [ python-Patches-965036 ] Fix for #777597 - socketmodule.c connection handling incorec

SourceForge.net noreply at sourceforge.net
Tue Jun 8 04:42:20 EDT 2004


Patches item #965036, was opened at 2004-06-02 15:57
Message generated for change (Comment added) made by troels
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=965036&group_id=5470

Category: Modules
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Troels Walsted Hansen (troels)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fix for #777597 - socketmodule.c connection handling incorec

Initial Comment:
I took Garth Bushell's inlined code from
http://python.org/sf/777597 and produced a patch per
nnorwitz's request in the bug comments. The patch is
for Python 2.3.4.

I created the patch as a starting point for a fix. I
don't believe that this patch is the correct fix for
the problem, so it should definitely not be applied in
the current form.

One major problem is that Garth removed the writefds
fd_set, which means that the code will detect
"connection refused" and "timeout" events, but not
"connection established". The code also needs
compliation and runtime testing (maybe even a
regression test to cover this common WinSock
programming error?).

I hope to submit a fixed and tested patch soon. I'll
upload it here when it is ready.


----------------------------------------------------------------------

>Comment By: Troels Walsted Hansen (troels)
Date: 2004-06-08 10:42

Message:
Logged In: YES 
user_id=32863

Here is the fixed patch. It compiles and passes the
regression test correctly on Windows 2003 Server.


----------------------------------------------------------------------

Comment By: Troels Walsted Hansen (troels)
Date: 2004-06-03 00:21

Message:
Logged In: YES 
user_id=32863

OK... As promised, here is the regression test.

The test passes on Linux and fails on Windows XP with Python
2.3.4 with the error below.

I'd appreciate any comments on the test.

FAIL: testTCPConnectionRefused
(__main__.TCPConnectionRefusedTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib\test\test_socket.py", line 752, in
testTCPConnectionRefused
    self.failUnlessEqual(exc_type, socket.error)
  File "C:\Program Files\Python23\lib\unittest.py", line
302, in failUnlessEqual

    raise self.failureException, AssertionError: <class socket.timeout at 0x00945510> !=
<class socket.error at 0x00945480>


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=965036&group_id=5470



More information about the Patches mailing list