[Patches] [ python-Patches-558547 ] SocketServer: don't flush closed wfile
noreply@sourceforge.net
noreply@sourceforge.net
Wed, 01 Jan 2003 19:09:13 -0800
Patches item #558547, was opened at 2002-05-21 16:07
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=558547&group_id=5470
Category: Library (Lib)
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Anthony Baxter (anthonybaxter)
Assigned to: Anthony Baxter (anthonybaxter)
Summary: SocketServer: don't flush closed wfile
Initial Comment:
I've found the following patch (well, ok, subclassed,
but the patch is the same) makes SocketServer more
robust. If wfile is already closed (prior to the
finish() method being called), don't try to flush()
it.
----------------------------------------------------------------------
>Comment By: Anthony Baxter (anthonybaxter)
Date: 2003-01-02 14:09
Message:
Logged In: YES
user_id=29957
committed as SocketServer.py, revision 1.35.
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2002-12-04 21:19
Message:
Logged In: YES
user_id=21627
I think the patch is fine. Please apply it.
----------------------------------------------------------------------
Comment By: Anthony Baxter (anthonybaxter)
Date: 2002-06-06 11:25
Message:
Logged In: YES
user_id=29957
I'm not _entirely_ sure why it happens that finish() gets called
twice - I suspect some form of race condition. Since many/most
other similar functions in the python library silently ignore a
close()-type operation (e.g. file.close(); file.close()). As
far as
the 'closed' attribute, well, yes, someone could subclass
StreamRequestHandler.setup, and leave
StreamRequestHandler.finish
as-is. But then, it's only got two methods, so this is
highly unlikely.
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2002-06-02 22:44
Message:
Logged In: YES
user_id=21627
Can you explain how this problem can ever occur? I.e. why
would there be two calls to finish?
Also, is there a guarantee that every thing returned by
makefile has a .closed attribute?
----------------------------------------------------------------------
Comment By: Anthony Baxter (anthonybaxter)
Date: 2002-05-21 16:25
Message:
Logged In: YES
user_id=29957
mm. i typ reel gud sometimes.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=558547&group_id=5470