spyder: TypeError in Outline explorer

Description

What steps will reproduce the problem?

Doing anything with outline explorer doesn’t do as expected. Clicking on Display variables and attributes will cause an error. special comments and def and class information is not displayed for all files

ADDENDUM (the next day) I have tracked down the issues to scripts in a project. If I close my project and navigate to a folder outside any project path and load any script, the outline pane displays as it should. You can click on a def or class and the code in the editor is navigated to.
More importantly, you can see the complete tree of your script’s functions/methods and classes to facilitate navigation and organization. Closing Spyder and reopening necessitates closing all open scripts and reloading them in order to get the tree information back

Traceback

  File "C:\arc_pro\bin\Python\envs\arcgispro-py3\lib\site-packages\spyder\plugins\outlineexplorer\widgets.py", line 433, in toggle_variables
    self.update_editor(editor.info, editor)
  File "C:\arc_pro\bin\Python\envs\arcgispro-py3\lib\site-packages\spyder\plugins\outlineexplorer\widgets.py", line 615, in update_editor
    update = self.update_tree(items, editor_id, language)
  File "C:\arc_pro\bin\Python\envs\arcgispro-py3\lib\site-packages\spyder\plugins\outlineexplorer\widgets.py", line 645, in update_tree
    for symbol in items:
TypeError: 'NoneType' object is not iterable
Traceback (most recent call last):
  File "C:\arc_pro\bin\Python\envs\arcgispro-py3\lib\site-packages\spyder\plugins\outlineexplorer\widgets.py", line 433, in toggle_variables
    self.update_editor(editor.info, editor)
  File "C:\arc_pro\bin\Python\envs\arcgispro-py3\lib\site-packages\spyder\plugins\outlineexplorer\widgets.py", line 615, in update_editor
    update = self.update_tree(items, editor_id, language)
  File "C:\arc_pro\bin\Python\envs\arcgispro-py3\lib\site-packages\spyder\plugins\outlineexplorer\widgets.py", line 645, in update_tree
    for symbol in items:
TypeError: 'NoneType' object is not iterable

Versions

  • Spyder version: 4.2.0
  • Python version: 3.7.9
  • Qt version: 5.9.6
  • PyQt5 version: 5.9.2
  • Operating System: Windows 10

Dependencies


# Mandatory:
atomicwrites >=1.2.0            :  1.4.0 (OK)
chardet >=2.0.0                 :  3.0.4 (OK)
cloudpickle >=0.5.0             :  1.6.0 (OK)
diff_match_patch >=20181111     :  20200713 (OK)
intervaltree >=3.0.2            :  3.1.0 (OK)
IPython >=4.0                   :  7.18.1 (OK)
jedi =0.17.2                    :  0.17.2 (OK)
jsonschema >=3.2.0              :  3.2.0 (OK)
nbconvert >=4.0                 :  5.6.1 (OK)
numpydoc >=0.6.0                :  1.1.0 (OK)
paramiko >=2.4.0                :  2.7.2 (OK)
parso =0.7.0                    :  0.7.0 (OK)
pexpect >=4.4.0                 :  4.8.0 (OK)
pickleshare >=0.4               :  0.7.5 (OK)
psutil >=5.3                    :  5.7.2 (OK)
pygments >=2.0                  :  2.7.0 (OK)
pylint >=1.0                    :  2.6.0 (OK)
pyls >=0.36.1;<1.0.0            :  0.36.1 (OK)
pyls_black >=0.4.6              :  0.4.6 (OK)
pyls_spyder >=0.1.1             :  0.2.1 (OK)
qdarkstyle >=2.8                :  2.8.1 (OK)
qtawesome >=0.5.7               :  1.0.1 (OK)
qtconsole >=4.7.7               :  4.7.7 (OK)
qtpy >=1.5.0                    :  1.9.0 (OK)
rtree >=0.8.3                   :  0.9.4 (OK)
setuptools >=39.0.0             :  51.0.0.post20201207 (OK)
sphinx >=0.6.6                  :  3.2.1 (OK)
spyder_kernels >=1.10.0;<1.11.0 :  1.10.0 (OK)
three_merge >=0.1.1             :  0.1.1 (OK)
watchdog >=0.10.3               :  0.10.4 (OK)
zmq >=17                        :  19.0.2 (OK)

# Optional:
cython >=0.21                   :  None (NOK)
matplotlib >=2.0.0              :  3.3.1 (OK)
numpy >=1.7                     :  1.19.2 (OK)
pandas >=1.1.1                  :  1.1.3 (OK)
scipy >=0.17.0                  :  1.5.2 (OK)
sympy >=0.7.3                   :  1.5.1 (OK)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 18 (6 by maintainers)

Most upvoted comments

Thank you. It solved the issue.