Project

Profile

Help

Bug #142

closed

Unhandled errors in the Python console

Added by Vincent Le Goff about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Category:
User interface
Sprint/Milestone:
% Done:

100%

Company:
-
Contact person:
-
Additional contact persons:
-

Description

When typing code causing exceptions of any kind in the Python console, a traceback occurs. To test:

  1. Open CocoMUD.
  2. Select a world (with or without a character) and connect to it.
  3. Open the Python console (menu bar, file, Python console).
  4. Enter something that will create an error, like print(unknown).

Error output:

Traceback (most recent call last):
  File "C:\Python36-32\Lib\code.py", line 91, in runcode
    exec(code, self.locals)
  File "<console>", line 1, in <module>
NameError: name 'unknown' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\src\cocomud\src\log.py", line 224, in run_with_except_hook
    run_original(*args2, **kwargs2)
  File "D:\src\cocomud\src\ui\dialogs\console.py", line 149, in run
    self.console.interact()
  File "D:\src\cocomud\src\ui\dialogs\console.py", line 100, in interact
    more = self.push(line)
  File "C:\Python36-32\Lib\code.py", line 259, in push
    more = self.runsource(source, self.filename)
  File "C:\Python36-32\Lib\code.py", line 75, in runsource
    self.runcode(code)
  File "C:\Python36-32\Lib\code.py", line 95, in runcode
    self.showtraceback()
  File "C:\Python36-32\Lib\code.py", line 149, in showtraceback
    sys.excepthook(ei[0], ei[1], last_tb)
  File "D:\src\cocomud\src\log.py", line 202, in excepthook
    dialog.ShowModal()
wx._core.wxAssertionError: C++ assertion "wxThread::IsMain()" failed at ..\..\src\msw\evtloop.cpp(182) in wxGUIEventLoop::Dispatch(): only the main thread can process Windows messages

The error should display in the Python console like a normal exception would in the Python interpreter. This might be due to wxPython's update.

Actions #1

Updated by Vincent Le Goff about 6 years ago

  • Status changed from Open to Closed
  • Assignee set to Vincent Le Goff
  • % Done changed from 0 to 100

Fixed in commit 2b064aa0366fb2743f1ef32867bbf8ff3e3c55f5. The error was due to a change in code.InteractiveConsole that followed the default except_hook if it were defined (and it is in CocoMUD).

Please register to edit this issue

Also available in: Atom PDF Tracking page