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.

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

Created on 2005-06-27 09:33 by tebeka, last changed 2022-04-11 14:56 by admin. This issue is now closed.

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 (6)
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.
msg168722 - (view) Author: Aaron Iles (aliles) * Date: 2012-08-21 00:25
Has this issue been resolved by issue been resolved by #12643, which has been merged for Python 3.3?
msg168725 - (view) Author: Miki Tebeka (tebeka) * Date: 2012-08-21 01:19
Seems like #12643 did solve this. Closing.
History
Date User Action Args
2022-04-11 14:56:11adminsetgithub: 42132
2012-08-21 01:19:16tebekasetstatus: open -> closed
resolution: fixed
messages: + msg168725
2012-08-21 00:25:42alilessetnosy: + ncoghlan, aliles
messages: + msg168722
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