All Questions
224 questions
0
votes
1
answer
40
views
updating python code in the middle of debugging
I often have to debug the python code by pdb debugger. It happens that it fails due to program errors that should be corrected. The problem is that I have to update the python code and restart the ...
1
vote
0
answers
37
views
Why won't the Python debugger invoked as a module automaticaly enter into post-mortem debugging?
Accordig to Python's official documentation at pdb:
You can also invoke pdb from the command line to debug other scripts. For example:
python -m pdb myscript.py
When invoked as a module, pdb will ...
0
votes
0
answers
216
views
Setting breakpoint() in pytest breaks within called functions rather than test function itself
When I set a breakpoint in my pytest test functions, it seems to be debugging within the functions called by test rather than the test itself:
def test_my_function():
test_value = np.random.choice(...
0
votes
1
answer
51
views
Python debugger convenience variable throws syntax error
I read in the Pdb documentation that
To set a temporary global variable, use a convenience variable. A convenience variable is a variable whose name starts with $. For example, $foo = 1 sets a global ...
0
votes
0
answers
36
views
How to automate pdb commands at a breakpoint() or set_trace()?
I have two complicated Python functions that follow each other. At the end of the second, I would like to occasionally call breakpoint() based on some values. To speed up my debugging, I can print ...
0
votes
0
answers
29
views
How to run pdb module commands in the code instead of in CLI?
I am working on a python debugger wherein I have a codespace (to enter code into) and some buttons (to control execution). I want to execute the entered code line-by-line on button click.
I found the ...
0
votes
0
answers
41
views
How do you programmatically pause the debugger from the debugged script and inspect the stack of every active thread?
I have a really determined glitch that occurs in conjunction with me seeing The filename, directory name, or volume label syntax is incorrect. printed to the console - which happens when the script ...
0
votes
1
answer
70
views
How to make display in pdb to work like display in gdb?
I'm learning to program and I've just switched to problem sets using Python language. Previously, I learned to write some small C programs. So when I debugged C programs, I used gdb and the display ...
1
vote
0
answers
64
views
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 ...
0
votes
1
answer
215
views
How to break in python when a warning is risen?
In python I'm getting difficult to debug warnings. I'd like to have the debugger break when one of these warnings happen, so I can poke arround the variables.
However I don't want to turn them into ...
0
votes
1
answer
126
views
Python breakpoint() automatically reads all STDIN -- how to disable it?
Here is a sample python script.
import sys
print("Hello, world!")
for i, line in enumerate(sys.stdin):
print(line)
print(f"Before breakpoint: {i}")
breakpoint()
...
1
vote
1
answer
94
views
SCONS PDB unable to find my file, even after I explicitly append it to the system path
I'm trying to debug a scons file as follows: scons --debug=pdb. When I try to set a breakpoint in SConstruct using b SConstruct:24 I get an error:
*** 'SConstruct' not found from sys.path
My ...
1
vote
1
answer
549
views
Debugging Python Module from within Github Repo in VSCode
I have a python library in github I want to debug. The library has setup.py as well as a pip released package. So I can install this module using either pip install git-sim or python3 setup.py install....
0
votes
0
answers
437
views
Calling private method in debug mode inside the class
I came across a question about Python debugger when working with pandas inside a class. In short, I could not call the "private method" in the debug console with its original(unmangled) ...
0
votes
1
answer
167
views
How to send messages to pdb on node.js?
I'm trying to write a node.js application that features a Python debugger GUI. Currently, I'm have a node.js application that calls a Python file with a pdb.set_trace(). I'm able to use node.js to ...