Aharon Sambol
Aharon Sambol

Reputation: 175

PyCharm getting different exceptions when running vs debugging

Recently I've been having this issue that I get different exceptions when running my code normally vs in debug mode, and sometimes even when it runs normally without hitting an Exception it will still hit an Exception during debugging, even with no break points.

Sometimes instead of an exception I'll get "Process finished with exit code -1073741819 (0xC0000005)" (while running fine when not debugging). I've looked this up but it seems to have random causes and none of the answers I've found worked for me.

If I place break points to see what's happening it will usually not have an exception...

Last time this happened I closed PyCharm and reopened it later an it started working normally but this keeps happening, and that fix doesn't work anymore.

I don't really have steps to reproduce since it seems to be random...

I'm using Windows, PyCharm 2020.2.3, python 3.10 and have no imports (other than re)

Upvotes: 1

Views: 316

Answers (1)

ehusmark
ehusmark

Reputation: 21

Possible solutions:

  • Downgrade Python. I've seen the same issue on 3.10, but not on 3.6.
  • Add extra breakpoints. In some cases adding more breakpoints prevents the issue - even a breakpoint in unreachable code.
  • Add an environment variable: PYDEVD_USE_CYTHON=NO. I'm not sure what effect that has though.

Upvotes: 1

Related Questions