Spyder: Spyder 4 not consistent at stopping at breakpoints in debugging.

Created on 12 Jan 2020  路  5Comments  路  Source: spyder-ide/spyder

Problem Description

Spyder 4 sometimes skip some breakpoints in debugging and stop at the next.
Restarting debugging never helps.
A don't know if it is a separate issue, but at pass keyword always skips breakpoints.

What steps reproduce the problem?

Stochastic:

  1. I set a breakpoint.
  2. Start Debug

What is the expected output? What do you see instead?

Always stopping at breakpoints

Versions

  • Spyder version: 4.0.1
  • Python version: 3.7.6 64 bit
  • Qt version: 5.9.6
  • PyQt version: 5.9.2
  • Operating System name/version: Windows 10

Dependencies

atomicwrites >=1.2.0 : 1.3.0 (OK)
chardet >=2.0.0 : 3.0.4 (OK)
cloudpickle >=0.5.0 : 1.2.2 (OK)
diff_match_patch >=20181111 : 20181111 (OK)
intervaltree : None (OK)
IPython >=4.0 : 7.11.1 (OK)
jedi =0.14.1 : 0.14.1 (OK)
nbconvert >=4.0 : 5.6.1 (OK)
numpydoc >=0.6.0 : 0.9.2 (OK)
pexpect >=4.4.0 : 4.7.0 (OK)
pickleshare >=0.4 : 0.7.5 (OK)
psutil >=0.3 : 5.6.7 (OK)
pygments >=2.0 : 2.5.2 (OK)
pylint >=0.25 : 2.4.4 (OK)
pyls >=0.31.2;<0.32.0 : 0.31.2 (OK)
zmq >=17 : 18.1.0 (OK)
qdarkstyle >=2.7 : 2.7 (OK)
qtawesome >=0.5.7 : 0.6.0 (OK)
qtconsole >=4.6.0 : 4.6.0 (OK)
qtpy >=1.5.0 : 1.9.0 (OK)
rtree >=0.8.3 : 0.8.3 (OK)
sphinx >=0.6.6 : 2.3.1 (OK)
spyder_kernels >=1.8.1;<2.0.0: 1.8.1 (OK)
watchdog : None (OK)
cython >=0.21 : None (NOK)
matplotlib >=2.0.0 : 3.1.1 (OK)
numpy >=1.7 : 1.17.4 (OK)
pandas >=0.13.1 : 0.25.3 (OK)
scipy >=0.17.0 : 1.3.2 (OK)
sympy >=0.7.3 : None (NOK)

NotSpyder

Most helpful comment

I share the problem

All 5 comments

I share the problem

I tried this:
Screenshot 2020-01-12 at 21 46 04
The debugger stops on line 2 and 3. Do you have a reproducible case?

Hello, thank you for your efforts!
I think your editor should have stop at 3, 2, in this order, maybe you wanted to write the same.
Anyway I tried it and works, but at me I think just because the pass is the last line of test().
So I tried this:
image
The debugger stops at 4 and 3.
So:

  1. Ctrl-F5:
    image
  2. Ctrl-F12:
    image
  3. Ctrl-F12:
    image

I can reproduce this, but the behaviour is the same in pdb, so I don't think this is a spyder bug. Trying this with "python3 -m pdb test.py" and test.py:

def test():
    pass
    print()
test()

print(0)

I am able to add a breakpoint on line 2 but it doesn't stop:

(Pdb) b 2
Breakpoint 1 at /Users/quentinpeter/Desktop/test.py:2

So I don't think this is something that can be solved at the spyder level.

For comparison, adding a breakpoint on line 5 gives:

(Pdb) b 5
*** Blank or comment

For more informations: https://docs.python.org/3.5/library/sys.html#sys.settrace

@impact27 Ok, I tested it in Spyder 3 and the same.
So, thank you for your help.

Was this page helpful?
0 / 5 - 0 ratings