[issue12643] code.InteractiveConsole ignores sys.excepthook

2011-07-27 Thread aliles
New submission from aliles : code.InteractiveConsole doesn't match the CPython interactive interpreter with respect to allowing sys.excepthook to handle exceptions. Unlike the interactive interpreter, replacing sys.excepthook with an alternate function will not change exception handling behavi

[issue12643] code.InteractiveConsole ignores sys.excepthook

2011-07-27 Thread STINNER Victor
STINNER Victor added the comment: What do you suggest? -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue12643] code.InteractiveConsole ignores sys.excepthook

2011-07-27 Thread aliles
aliles added the comment: OK. Not something I was expecting to be asked. But cool :D If it's not possible for InteractiveConsole to allow exceptions to propagate through sys.excepthook. (I assume they are being caught in a try: catch: block) check sys.excepthook for a custom exception handler

[issue12643] code.InteractiveConsole ignores sys.excepthook

2011-07-27 Thread STINNER Victor
STINNER Victor added the comment: > If it's not possible for InteractiveConsole to allow exceptions > to propagate through sys.excepthook. Ok, I was not sure that I understood correctly. This change should be an option to not break existing code. -- __

[issue12643] code.InteractiveConsole ignores sys.excepthook

2011-07-27 Thread aliles
aliles added the comment: Yes. I have code that behaves differently under CPython and PyPy because of this issue. Admittedly that code is somewhat evil. It's attached for reference, in particular the __HelpSyntax class. -- Added file: http://bugs.python.org/file22773/startup.py

[issue12643] code.InteractiveConsole ignores sys.excepthook

2011-07-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: If someone is setting sys.excepthook, they are not expecting it to be ignored, so I think there's no reason to preserve existing behaviour. On the other hand, it is easy to customize exception printout by subclassing InteractiveConsole and overriding the show

[issue12643] code.InteractiveConsole ignores sys.excepthook

2011-07-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: Another possibility yet is to add an "excepthook" argument to the InteractiveInterpreter / InteractiveConsole constructors. -- ___ Python tracker

[issue12643] code.InteractiveConsole ignores sys.excepthook

2012-03-28 Thread Florent Xicluna
Changes by Florent Xicluna : -- nosy: +flox ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue12643] code.InteractiveConsole ignores sys.excepthook

2012-08-20 Thread aliles
aliles added the comment: Submitted patch. Patch creates a new unit test suite with basic unit tests for InteractiveConsole. Enhances InteractiveConsole to call sys.excepthook instead of it's own handler if the user has overridden the excepthook. The unit tests use the new unittest.mock module

[issue12643] code.InteractiveConsole ignores sys.excepthook

2012-08-20 Thread Andrew Svetlov
Changes by Andrew Svetlov : -- nosy: +asvetlov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue12643] code.InteractiveConsole ignores sys.excepthook

2012-08-20 Thread aliles
aliles added the comment: New patch to address comments provide by Nick Coghlan in person at PyCon-AU 2012. -- Added file: http://bugs.python.org/file26928/issue12643_2.diff ___ Python tracker

[issue12643] code.InteractiveConsole ignores sys.excepthook

2012-08-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset a812de69b493 by Nick Coghlan in branch 'default': Issue #12643: Respect sys.excepthook in code.InteractiveConsole http://hg.python.org/cpython/rev/a812de69b493 -- nosy: +python-dev ___ Python tracker

[issue12643] code.InteractiveConsole ignores sys.excepthook

2012-08-20 Thread Andrew Svetlov
Andrew Svetlov added the comment: Is it finished or not? Also looks like patch applied to 3.3 while issue marked for 2.7 and 3.2 also. -- ___ Python tracker ___ _

[issue12643] code.InteractiveConsole ignores sys.excepthook

2012-08-20 Thread Nick Coghlan
Nick Coghlan added the comment: The patch also adds a test suite for the code module, in order to demonstrate that the issue is actually fixed. However, due to the interactive nature of the component, the new tests rely on unittest.mock. Backporting the test suite would mean eliminating that

[issue12643] code.InteractiveConsole ignores sys.excepthook

2012-08-20 Thread Andrew Svetlov
Andrew Svetlov added the comment: I'm ok with current status. Thanks for clarification. -- ___ Python tracker ___ ___ Python-bugs-list