This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Todd.Rovito
Recipients Todd.Rovito, amaury.forgeotdarc, asvetlov, devplayer, ggenellina, ned.deily, roger.serwy, terry.reedy
Date 2013-07-07.04:26:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
   Bottom line I can't seem to get this patch to do anything for me.  Before the patch is applied IDLE seems to be handling warnings and exceptions just fine in PyShell on the Mac.  I get no crash and the output matches the normal console.  Here is a small test program I wrote:
import warnings

def fxn():
    # user warnings are not ignored by default and will cause a dump of information
    # to standard error.
    warnings.warn("User warning: Warn on purpose for IDLE", UserWarning)

if __name__ == "__main__":
    print("the program should not terminate with the warning, but keep on running")
    a = 10 * 1000

    # exception testing each of these will stop the program
    # divide by zero
    b = 10 * (1/0)
    # variable not defined
    c = 4 + spam*3
    # can't convert 'int' object o str implicitly
    d = '2' + 2

Then I wanted to make sure I was executing the patched code so I made sure I called idle.pyw (normally I wouldn't do that I would use  After I called the correct script I changed the code to force std error to ErrorNotify class around line 101:
import sys

##if 0: # For testing
##    sys.__stderr__ = None
##    sys.stderr = None

if sys.__stderr__ is None:
    sys.__stderr__ = ErrorNotify()

if sys.stderr is None:
    sys.stderr = ErrorNotify()

if sys.__stdout__ is None:
    sys.__stdout__ = ErrorNotify(devnull=True)

if sys.stdout is None:
    sys.stdout = ErrorNotify(devnull=True)

sys.__stderr__ = ErrorNotify()
sys.stderr = ErrorNotify()

I would expect after this code runs any message sent to stderr would go through the ErrorNotify class and a widget should appear with the stderr output.  Even after this change I can't get the error widget to appear.  I have not given up yet but I wanted to provide a status update.
Date User Action Args
2013-07-07 04:26:50Todd.Rovitosetrecipients: + Todd.Rovito, terry.reedy, amaury.forgeotdarc, ggenellina, ned.deily, roger.serwy, asvetlov, devplayer
2013-07-07 04:26:50Todd.Rovitosetmessageid: <>
2013-07-07 04:26:50Todd.Rovitolinkissue13582 messages
2013-07-07 04:26:50Todd.Rovitocreate