Python Forum
How to make Python stops for debugging when the error occurs?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make Python stops for debugging when the error occurs?
#1
Hi,
Is there a way to start the debugging mode at the point when error occurs?
I do not like using the conditioned "Breakpoint", I want the debugger add automatic Breakpoint at the location of error, and exactly one the error happens.

Thank you,
Reply
#2
Python doesn't know that an error has occurred. It only knows that an exception is being raised, but this does not necessarily indicate an error.
Reply
#3
which (if any) IDE are you using?
Reply
#4
(Feb-15-2018, 11:06 AM)Larz60+ Wrote: which (if any) IDE are you using?

I'm using PyCharm
Reply
#5
The PyCharm debugger will stop on the line you wish by clicking in the left border.
It works really well.

There is of course no reliable way that it can create an 'automatic Breakpoint'. I guess one could theorize a scenario where a breakpoint could be placed on the instruction prior to the program crash, but in reality this can't be done, Take for instance when the crash occurs in a thread, in addition, the call stack is often destroyed as soon as the crash occurs. Even is it could be accessed, there is no way to insure it's integrity.
Reply
#6
Thank you all.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  OSError occurs in Linux. anna17 2 192 Mar-23-2024, 10:00 PM
Last Post: snippsat
  pip stops waiting for python walker 6 970 Nov-28-2023, 06:55 PM
Last Post: walker
  Understanding and debugging memory error crashes with python3.10.10 Arkaik 5 1,978 Apr-18-2023, 03:22 AM
Last Post: Larz60+
  [SOLVED] [Linux] Script in cron stops after first run in loop Winfried 2 894 Nov-16-2022, 07:58 PM
Last Post: Winfried
  how to make this error stop ? Mawixy 1 2,851 Apr-19-2022, 03:02 PM
Last Post: Mawixy
  Know when the pyttsx3 engine stops talking UsualCoder 3 3,143 Aug-29-2021, 11:08 PM
Last Post: snippsat
  IDLE stops responding upon saving tompi1 2 1,890 Oct-01-2020, 05:44 PM
Last Post: Larz60+
  Python Module to display Dictionairies for debugging personalt 3 2,031 Jun-20-2020, 12:39 PM
Last Post: Yoriz
  Python timer script stops before should ozstar 3 2,175 May-04-2020, 12:55 AM
Last Post: ozstar
  Python stops without errors shahgourav 4 2,706 Feb-04-2020, 11:44 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020