PyCharm 2019.2 not showing Traceback on Exception

Question:

Very simple minimal example:

if __name__ == '__main__':
    print("Still ok")
    raise Exception("Dummy exception")
    print("End of Program")

I get this output when running it in the PyCharm 2019.2 debugger with Python 3.6:

/usr/bin/python3.6 /home/[...]/pycharm-community-2019.2/helpers/pydev/pydevd.py --multiproc --qt-support=auto --client 127.0.0.1 --port 46850 --file /home/[...]/test_traceback.py
pydev debugger: process 18394 is connecting

Connected to pydev debugger (build 192.5728.105)
Still ok

At this point the debugger breaks the execution flow but no Traceback and Exception message is shown in the Debugger console. If I run the same in PyCharm 2018.1 it does show these right when the breakpoint is hit.

When I hit Continue, I get the desired output, but then I can’t run code in the debugging context anymore because the process ends:

Traceback (most recent call last):
  File "/home/[...]/pycharm-community-2019.2/helpers/pydev/pydevd.py", line 2060, in <module>
    main()
  File "/home/[...]/pycharm-community-2019.2/helpers/pydev/pydevd.py", line 2054, in main
    globals = debugger.run(setup['file'], None, None, is_module)
  File "/home/[...]/pycharm-community-2019.2/helpers/pydev/pydevd.py", line 1405, in run
    return self._exec(is_module, entry_point_fn, module_name, file, globals, locals)
  File "/home/[...]/pycharm-community-2019.2/helpers/pydev/pydevd.py", line 1412, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/home/[...]/pycharm-community-2019.2/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"n", file, 'exec'), glob, loc)
  File "/home/[...]/test_traceback.py", line 4, in <module>
    raise Exception("Dummy exception")
Exception: Dummy exception

Process finished with exit code 1

My Breakpoint configuration:

Breakpoint config

Asked By: Philipp F

||

Answers:

did you check your whitespaces at start of each executable line? one time it occured to me was fixed after just correcting the whitespaces.

Answered By: Jim Svi

It works on PyCharm (Community) 2019.1.4:

Img0

Seems like you ran into a (regression) bug:

which affects v2019.2.1, and is scheduled to be fixed in v2019.2.3.

To get past this issue, you’ll have to either:

  • Wait for v2019.2.3 (or any other that has the fix) to be released, and switch to that (might want to (periodically) check [JetBrains.Blog]: Release Announcements)

  • Revert to a (previous) version which is not affected by the bug (as I already mentioned: 2019.1.4)


Update #0

Installed (on 20190930) latest patch (v2019.2.3), and the traceback is present in PyCharm‘s console (so, the bug is fixed).

Answered By: CristiFati
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.