spyder: Step-by-step debugging with IPython console doesn't work in 3.1.4.

Description

After upgrading from Spyder 3.1.3 to 3.1.4, step-by-step debugging with IPython in Spyder doesn’t work anymore as it fails on all programs after a few single-steps with the error “Restarting kernel because an error occurred while debugging”. Single-step debugging the same code in an ipython terminal works fine, so it seems to only be a problem when debugging via Spyder.

What steps will reproduce the problem?

  1. Start the debugger on any program, e.g. the trivial test program below.
  2. Single-step a couple of times for the error to occur. It is not consistent how many single-steps are required before the error occurs, but it is just a few and thus effectively making debugging in Spyder unusable.

What is the expected output? What do you see instead? Single-step debugging should work.

Please provide any additional information below Here is the trivial test program (test.py) used:

for i in range(10):
    print("i = {}".format(i))

The IPython console output when single-step debugging the test program in Spyder is as follows:

Python 3.5.3 (v3.5.3:1880cb95a742, Jan 16 2017, 16:02:32) [MSC v.1900 64 bit (AMD64)] Type “copyright”, “credits” or “license” for more information.

IPython 6.0.0 – An enhanced Interactive Python.

debugfile(‘C:/Users/lars/Desktop/test.py’, wdir=‘C:/Users/lars/Desktop’)

c:\users\lars\desktop\test.py(1)<module>() ----> 1 for i in range(10): 2 print(“i = {}”.format(i)) 3 4

c:\users\lars\desktop\test.py(2)<module>() 1 for i in range(10): ----> 2 print(“i = {}”.format(i)) 3 4

i = 0

c:\users\lars\desktop\test.py(1)<module>() ----> 1 for i in range(10): 2 print(“i = {}”.format(i)) 3 4

ipdb> ipdb> > c:\users\lars\desktop\test.py(2)<module>() 1 for i in range(10): ----> 2 print(“i = {}”.format(i)) 3 4

ipdb> i = 1

c:\users\lars\desktop\test.py(1)<module>() ----> 1 for i in range(10): 2 print(“i = {}”.format(i)) 3 4

c:\users\lars\desktop\test.py(2)<module>() 1 for i in range(10): ----> 2 print(“i = {}”.format(i)) 3 4

ipdb> Restarting kernel because an error occurred while debugging

ipdb> Kernel died, restarting

Version and main components

  • Spyder Version: 3.1.4
  • Python Version: 3.5.3
  • Qt Versions: 5.8.0, PyQt5 5.8.2 on Windows

Dependencies

jedi >=0.9.0     :  0.10.2 (OK)
matplotlib >=1.0 :  2.0.0 (OK)
nbconvert >=4.0  :  5.1.1 (OK)
numpy >=1.7      :  1.12.1 (OK)
pandas >=0.13.1  :  None (NOK)
pep8 >=0.6       :  1.7.0 (OK)
pyflakes >=0.6.0 :  1.5.0 (OK)
pygments >=2.0   :  2.2.0 (OK)
pylint >=0.25    :  1.7.1 (OK)
qtconsole >=4.2.0:  4.3.0 (OK)
rope >=0.9.4     :  0.9.4-1 (OK)
sphinx >=0.6.6   :  1.5.5 (OK)
sympy >=0.7.3    :  None (NOK)

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Reactions: 3
  • Comments: 24 (11 by maintainers)

Most upvoted comments

This bug only happens if you’re using print’s in the middle of a debugging session. Sorry for that, we didn’t consider that case.

To revert to 3.1.3 (3.1.2 has other ugly bugs) you have to run

conda install spyder=3.1.3

or

pip install spyder==3.1.3

done. thank you