Spyder: Error when opening a new project

Created on 22 Sep 2017  路  4Comments  路  Source: spyder-ide/spyder

Description

What steps will reproduce the problem?



    1. 2.
  1. 3.

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

Please provide any additional information below

File "/home/srt/anaconda3/lib/python3.6/site-packages/spyder/plugins/projects.py", line 148, in
lambda v: self.editor.setup_open_files())
File "/home/srt/anaconda3/lib/python3.6/site-packages/spyder/plugins/editor.py", line 2662, in setup_open_files
self.close_all_files()
File "/home/srt/anaconda3/lib/python3.6/site-packages/spyder/plugins/editor.py", line 1974, in close_all_files
self.editorstacks[0].close_all_files()
File "/home/srt/anaconda3/lib/python3.6/site-packages/spyder/widgets/editor.py", line 1408, in close_all_files
while self.close_file():
File "/home/srt/anaconda3/lib/python3.6/site-packages/spyder/widgets/editor.py", line 1370, in close_file
self.remove_from_data(index)
File "/home/srt/anaconda3/lib/python3.6/site-packages/spyder/widgets/editor.py", line 1163, in remove_from_data
self.update_fileswitcher_dlg()
File "/home/srt/anaconda3/lib/python3.6/site-packages/spyder/widgets/editor.py", line 822, in update_fileswitcher_dlg
self.fileswitcher_dlg.setup()
File "/home/srt/anaconda3/lib/python3.6/site-packages/spyder/widgets/fileswitcher.py", line 757, in setup
current_path = self.current_path
File "/home/srt/anaconda3/lib/python3.6/site-packages/spyder/widgets/fileswitcher.py", line 346, in current_path
return self.paths_by_widget[self.get_widget()]
KeyError: None
WARNING:traitlets:kernel died: 6.005160331726074

Version and main components

  • Spyder Version: 3.2.3
  • Python Version: 3.6.2
  • Qt Versions: 5.6.2, PyQt5 5.6 on Linux

Dependencies

pyflakes >=0.6.0 :  1.5.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pygments >=2.0   :  2.1.3 (OK)
pandas >=0.13.1  :  0.19.2 (OK)
numpy >=1.7      :  1.11.3 (OK)
sphinx >=0.6.6   :  1.5.1 (OK)
rope >=0.9.4     :  0.9.4-1 (OK)
jedi >=0.9.0     :  0.9.0 (OK)
psutil >=0.3     :  5.1.3 (OK)
nbconvert >=4.0  :  4.2.0 (OK)
sympy >=0.7.3    :  1.0 (OK)
cython >=0.21    :  0.25.2 (OK)
qtconsole >=4.2.0:  4.2.1 (OK)
IPython >=4.0    :  5.1.0 (OK)
pylint >=0.25    :  1.6.4 (OK)

File Switcher 3-Moderate Bug

All 4 comments

@ccordoba12 There it is, our full traceback for Issue #5277 :)

Yep, that's right. Thanks for noticing it @jnsebgosselin!

What steps will reproduce the problem?

  1. Open Spyder
  2. Open a Project
  3. Open the editorstack's fileswithcer (the one accessed through the cog menu), not the global one.
  4. Close project or change project.
Traceback (most recent call last):
  File "C:\Users\jsgosselin\spyder\spyder\plugins\projects.py", line 148, in <lambda>
    lambda v: self.editor.setup_open_files())
  File "C:\Users\jsgosselin\spyder\spyder\plugins\editor.py", line 2662, in setup_open_files
    self.close_all_files()
  File "C:\Users\jsgosselin\spyder\spyder\plugins\editor.py", line 1974, in close_all_files
    self.editorstacks[0].close_all_files()
  File "C:\Users\jsgosselin\spyder\spyder\widgets\editor.py", line 1445, in close_all_files
    while self.close_file():
  File "C:\Users\jsgosselin\spyder\spyder\widgets\editor.py", line 1407, in close_file
    self.remove_from_data(index)
  File "C:\Users\jsgosselin\spyder\spyder\widgets\editor.py", line 1173, in remove_from_data
    self.update_fileswitcher_dlg()
  File "C:\Users\jsgosselin\spyder\spyder\widgets\editor.py", line 832, in update_fileswitcher_dlg
    self.fileswitcher_dlg.setup()
  File "C:\Users\jsgosselin\spyder\spyder\widgets\fileswitcher.py", line 757, in setup
    current_path = self.current_path
  File "C:\Users\jsgosselin\spyder\spyder\widgets\fileswitcher.py", line 346, in current_path
    return self.paths_by_widget[self.get_widget()]
KeyError: None

OR

  1. Open Spyder
  2. Open the editorstack's fileswithcer (the one accessed through the cog menu), not the global one.
  3. Close all files in the editor
Traceback (most recent call last):
  File "C:\Users\jsgosselin\spyder\spyder\widgets\editor.py", line 1450, in close_file
    self.remove_from_data(index)
  File "C:\Users\jsgosselin\spyder\spyder\widgets\editor.py", line 1211, in remove_from_data
    self.update_fileswitcher_dlg()
  File "C:\Users\jsgosselin\spyder\spyder\widgets\editor.py", line 852, in update_fileswitcher_dlg
    self.fileswitcher_dlg.setup()
  File "C:\Users\jsgosselin\spyder\spyder\widgets\fileswitcher.py", line 757, in setup
    current_path = self.current_path
  File "C:\Users\jsgosselin\spyder\spyder\widgets\fileswitcher.py", line 346, in current_path
    return self.paths_by_widget[self.get_widget()]
KeyError: None

Version and main components

  • Spyder Version: branch 3.x and master
  • Python Version: 3.6.2
  • Qt Version: 5.9.1
  • PyQt Version: 5.9
  • Operating system: Windows 7 64 bits

crash_when_switching_project

@ccordoba12 it's not related to the component: Project label per se. We need a label for component: File Switcher.

The issue happens when all files are closed at some point in the Editor. It happens when switching or closing project because we close all the files in the Editor when doing so,

Was this page helpful?
0 / 5 - 0 ratings