classification
Title: code.py use sys.excepthook to display exceptions
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.2
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Trundle, mwh, tebeka
Priority: normal Keywords: easy, patch

Created on 2005-06-27 09:33 by tebeka, last changed 2011-04-09 02:38 by Trundle.

Files
File name Uploaded Description Edit
code.patch tebeka, 2005-06-27 09:33 Patch for code.py
code1.patch tebeka, 2005-06-28 06:44 Patch file
Messages (4)
msg48525 - (view) Author: Miki Tebeka (tebeka) Date: 2005-06-27 09:33
This patch makes code.py InteractiveInterpreter use
sys.excepthook to display exceptions.

This way if a user changes sys.excepthook it will be
used by the InteractiveInterpreter.
msg48526 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2005-06-27 10:57
Logged In: YES 
user_id=6656

Seems like a good idea to me.

The only quibble around the area of self.write -- it might break code that 
overrides that (IDLE?).  Also, shouldn't showsyntaxerror be changed too?
msg48527 - (view) Author: Miki Tebeka (tebeka) Date: 2005-06-28 06:44
Logged In: YES 
user_id=358087

OK. Changed syntaxerror as well (see attached patch).

Not sure I understand the comment about self.write.
Overiding sys.excepthook in IDLE does *not* work.
(sys.displayhook does though).
msg48528 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2005-06-28 08:08
Logged In: YES 
user_id=6656

> Not sure I understand the comment about self.write.
> Overiding sys.excepthook in IDLE does *not* work.
> (sys.displayhook does though).

Yeah, sure, your patch changes that, but I think that with your patch idle 
will need to install its own sys.excepthook or exception messages will end 
up on the real stderr.
History
Date User Action Args
2011-04-09 02:38:30Trundlesetnosy: + Trundle
2010-08-21 16:10:00BreamoreBoysetstage: test needed -> patch review
versions: + Python 3.2, - Python 2.7
2009-02-16 02:25:41ajaksu2setkeywords: + easy
stage: test needed
type: enhancement
versions: + Python 2.7, - Python 2.5
2005-06-27 09:33:01tebekacreate