Questions tagged [ipdb]

Interactive Python Debugger, IPython-interface to pdb

ipdb exports functions to access the IPython debugger, which features tab completion, syntax highlighting, better tracebacks, better introspection with the same interface as the pdb module.

192 questions
1
vote
1 answer

Start pdb on exception in Tornado's ioloop

It's often useful to do this in standalone Python programs: def excepthook(typ, value, tb): traceback.print_exception(typ, value, tb) pdb.pm() ... if log.getEffectiveLevel() == logging.DEBUG: sys.excepthook = excepthook (i.e. if…
LetMeSOThat4U
  • 6,470
  • 10
  • 53
  • 93
1
vote
1 answer

ipdb: tracing via additional code on demand | python

I use import ipdb;ipdb.set_trace() Sometimes, while debugging with set_trace I want verify some method out of frame/source (invoke it with my parameters, and see how it works inside). Method is not used yet in code, so jump is impossible. sth…
Sławomir Lenart
  • 7,543
  • 4
  • 45
  • 61
0
votes
0 answers

How can I repeatedly list code around the current line with pdb?

The l command for pdb is documented like so: l: List source code for the current file. Without arguments, list 11 lines around the current line or continue the previous listing. I often use this command (in ipdb as well) to see where I am, then…
Anton
  • 365
  • 2
  • 12
0
votes
0 answers

configuring ipdb to change the meaning of "!"

When I call import ipdb; ipdb.set_trace(), I'm able to step through the program by entering just n, but if I have a variable named n that I want to inspect I have to type !n or p n ("print" n). This often messes me up. Is there a way to change the…
clwainwright
  • 1,624
  • 17
  • 21
0
votes
0 answers

Debugger in a Jupyter Notebook on Windows doesn't run code in my cell

I would like to run and debug some (Sage) code in Windows 10 using pdb, by setting a breakpoint() in a cell. When I do that, a pdb prompt appears, but it enters into code that is run by (I assume) the interpreter, and not the code in the cell. I…
Ricardo
  • 19
  • 2
0
votes
0 answers

Python memory leak in Google Collab when interrupting the run

I'm running the following code in Google Collab (and on Kaggle Notebook). When running it without pdb.set_trace(), everything works fine. However, when using pdb.set_trace() and calling "continue/exit", it seems that the array is still stored in…
Ben Lahav
  • 73
  • 7
0
votes
0 answers

How to return to `ipdb` prompt from `IPython` prompt

I've recently started using ipdb for debugging. Colours are nicer than with the default debugger. But I keep finding myself in an IPython prompt, and whenever I exit the IPython prompt I exit the whole program. How do I return from the IPython…
Alan Buxton
  • 186
  • 10
0
votes
0 answers

ipdb: how to continue until next file is reached

I'm debugging python code and I would find it very helpful if I can continue the execution of the program (just like using c) BUT break at the first executed line if a new file is being run. Is it possible? The reason I want to do that is I want to…
WalksB
  • 498
  • 2
  • 14
0
votes
1 answer

Is there a way to use python debugger in airflow dags?

I am running airflow locally without docker or helm, and am using SequentialExecutor as the executor, I want to use pdb or ipdb debugger inside callable functions of PythonOperator. is there a way for it?
Prinz Piuz
  • 69
  • 9
0
votes
1 answer

launch_ipdb_on_exception() gives :Context manager 'generator' doesn't implement __enter__ and __exit__. [E1129]

I am using: ipdb (ipdb==0.13.9). For the with launch_ipdb_on_exception(): line in code-block from answer for Launch an IPython shell on exception from ipdb import launch_ipdb_on_exception def main(): with launch_ipdb_on_exception(): #…
alper
  • 2,919
  • 9
  • 53
  • 102
0
votes
0 answers

Python: print but don't process control characters (print them literally)

(python 2.7) I am used to debug stuff in my IDE and see if the service returns CR/LF/CRLF (actually important for my application). However, now I am in this python project that is very tricky to debug. So, I am using ipdb and just printing my…
DraxDomax
  • 1,008
  • 1
  • 9
  • 28
0
votes
0 answers

Issue with List Expressions or Debugger: NameError: name is not defined

I am using the following code to figure out if an Edge definition is existing already and either get a NameError or a False where should be a True. The code is the following: @staticmethod def doesGraphHasEdgeDefinition(arangograph,…
Qohelet
  • 1,459
  • 4
  • 24
  • 41
0
votes
1 answer

ipdb set_trace() is not working properly in spyder

I am using Spyder When I write these lines : import ipdb; ipdb.set_trace() When I press n the program always returns me to the following interactive shell error --Return-- None > (7)() 6 ----> 7 import…
Camilo
  • 39
  • 1
  • 3
0
votes
2 answers

pdb debugger escape from set_trace

Whenever I set the cell with import pdb pdb.set_trace() a = 100 inside a jupyter notebook, tracer will get into the set_trace() method with n instead the next line. I don't know what to do? How can I get the next line a = 100. To be worse even…
Max
  • 11
0
votes
1 answer

how to make flake8 ignore ipdb imports?

I'm trying to clean flake8 errors from my code, and I have an ipdb import which should stay there. I tried: import ipdb # noqa: F811 import ipdb # NOQA import ipdb # noqa But all give the same error: - ipdb imported How can I make it go…
CIsForCookies
  • 12,097
  • 11
  • 59
  • 124