[Python-bugs-list] [ python-Bugs-483126 ] cgitb does not recover

noreply@sourceforge.net noreply@sourceforge.net
Tue, 04 Dec 2001 08:51:47 -0800


Bugs item #483126, was opened at 2001-11-18 10:38
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=483126&group_id=5470

Category: Python Library
Group: Python 2.1.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Dan Grassi (dgrassi)
>Assigned to: Ka-Ping Yee (ping)
Summary: cgitb does not recover

Initial Comment:
chitb does not recover when sys.stdout has been 
resigned.  The fix is simple, set sys.stdout to 
sys.__stdout__ in cgitb.handle right after the 
import of sys.

line 160:
    def handle(self, info=None):
        import sys
+       sys.stdout = sys.__stdout__
        print reset()


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

>Comment By: Guido van Rossum (gvanrossum)
Date: 2001-12-04 08:51

Message:
Logged In: YES 
user_id=6380

Passing this to Ping. Note: using sys.__stdout__ is rarely
the right thing -- who knows if sys.stdout hasn't been
reassigned for a good reason?

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

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=483126&group_id=5470