Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging seems to break with recent versions of Spyder and tqdm #4003

Closed
GeertLitjens opened this issue Jan 19, 2017 · 2 comments
Closed

Debugging seems to break with recent versions of Spyder and tqdm #4003

GeertLitjens opened this issue Jan 19, 2017 · 2 comments

Comments

@GeertLitjens
Copy link

GeertLitjens commented Jan 19, 2017

Debugging seems to break with recent versions of Spyder and tqdm. The internal console gives the following output:

Traceback (most recent call last):
  File "D:\code\thirdparty\spyder\spyder\widgets\ipythonconsole\namespacebrowser.py", line 49, in <lambda>
    self.namespacebrowser.process_remote_view(data))
  File "D:\code\thirdparty\spyder\spyder\widgets\variableexplorer\namespacebrowser.py", line 232, in process_remote_view
    self.set_data(remote_view)
  File "D:\code\thirdparty\spyder\spyder\widgets\variableexplorer\namespacebrowser.py", line 243, in set_data
    self.editor.set_data(data)
  File "D:\code\thirdparty\spyder\spyder\widgets\variableexplorer\collectionseditor.py", line 830, in set_data
    self.model.set_data(data, self.dictfilter)
  File "D:\code\thirdparty\spyder\spyder\widgets\variableexplorer\collectionseditor.py", line 170, in set_data
    self.set_size_and_type()
  File "D:\code\thirdparty\spyder\spyder\widgets\variableexplorer\collectionseditor.py", line 185, in set_size_and_type
    for index in range(start, stop) ]
TypeError: 'int' object has no attribute '__getitem__'

What steps will reproduce the problem?

  1. Make a simple script (e.g.):
import tqdm

1 + 1

b = 3 

print "Awesome"

c = 4

print "Awesome as well"
  1. Put a breakpoint anywhere (e.g. print "Awesome")
  2. Try to debug and press continue.

What is the expected output? What do you see instead?
Expect output would be to stop at the line and show a short print of the code:

     12 b = 3
     13 
2--> 14 print "Awesome"
     15 
     16 c = 4

instead you get:

{'e': {'color': '#0000ff', 'view': '2.718281828459045', 'type': u'float', 'size': 1}, 'euler_gamma': {'color': '#0000ff', 'view': '0.5772156649015329', 'type': u'float', 'size': 1}, 'pi': {'color': '#0000ff', 'view': '3.141592653589793', 'type': u'float', 'size': 1}, 'b': {'color': '#0000ff', 'view': '3', 'type': u'int', 'size': 1}}

Versions and main components

  • Spyder Version: 3.1.0
  • Python Version: 2.7.13
  • Operating system: Windows 10 x64

Dependencies

Please go to the menu entry Help > Optional Dependencies (or
Help > Dependencies), press the button Copy to clipboard
and paste the contents below:

jedi >=0.8.1 : 0.9.0 (OK)
matplotlib >=1.0 : 2.0.0 (OK)
nbconvert >=4.0 : 5.0.0 (OK)
numpy >=1.7 : 1.12.0 (OK)
pandas >=0.13.1 : 0.19.2 (OK)
pep8 >=0.6 : 1.7.0 (OK)
pyflakes >=0.5.0 : 1.5.0 (OK)
pygments >=2.0 : 2.1.3 (OK)
pylint >=0.25 : 1.6.4 (OK)
qtconsole >=4.2.0: 4.2.1 (OK)
rope >=0.9.4 : 0.10.3 (OK)
sphinx >=0.6.6 : 1.5.1 (OK)
sympy >=0.7.3 : 1.0 (OK)

@ccordoba12
Copy link
Member

Thanks for reporting and for the reproducible example. We'll try to fix this error in our next release.

@dalthviz, please take a look at this one and create a PR for it as soon as possible.

@ccordoba12
Copy link
Member

@GeertLitjens, I'm sorry to let you know that the solution to this problem is for Spyder to automatically restart the kernel if tqdm is present while debugging.

The problem is tqdm messes horribly with stdout on Windows, and that breaks our debugging facilities. @dalthviz worked hard on this one and found no other solution, sorry.

ccordoba12 added a commit that referenced this issue Feb 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants