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

File switcher error #5384

Closed
ram15565 opened this issue Oct 3, 2017 · 8 comments
Closed

File switcher error #5384

ram15565 opened this issue Oct 3, 2017 · 8 comments

Comments

@ram15565
Copy link

ram15565 commented Oct 3, 2017

Description

What steps will reproduce the problem?

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

Please provide any additional information below

File "/usr/local/lib/python3.5/dist-packages/spyder/app/mainwindow.py", line 2795, in open_fileswitcher
self.fileswitcher.setup()
File "/usr/local/lib/python3.5/dist-packages/spyder/widgets/fileswitcher.py", line 757, in setup
current_path = self.current_path
File "/usr/local/lib/python3.5/dist-packages/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: 3.2.3
  • Python Version: 3.5.2
  • Qt Versions: 5.9.1, PyQt5 5.9 on Linux

Dependencies

pyflakes >=0.6.0 :  1.6.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pygments >=2.0   :  2.2.0 (OK)
pandas >=0.13.1  :  0.17.1 (OK)
numpy >=1.7      :  1.11.0 (OK)
sphinx >=0.6.6   :  1.6.4 (OK)
rope >=0.9.4     :  0.10.7 (OK)
jedi >=0.9.0     :  0.11.0 (OK)
psutil >=0.3     :  5.3.1 (OK)
nbconvert >=4.0  :  5.3.1 (OK)
sympy >=0.7.3    :  None (NOK)
cython >=0.21    :  None (NOK)
qtconsole >=4.2.0:  4.3.1 (OK)
IPython >=4.0    :  6.2.1 (OK)
pylint >=0.25    :  1.7.4 (OK)

@jnsebgosselin
Copy link
Member

@ccordoba12 I'm going to take a look at it.

@ram15565 Thanks for the report. Could you tell us a little bit more about what you were doing when the error happened?

@jnsebgosselin
Copy link
Member

jnsebgosselin commented Oct 3, 2017

For the record, this is not a duplicate, but this is related to Issue #5317. These two issues could probably be fixed with the same PR.

@jnsebgosselin jnsebgosselin self-assigned this Oct 3, 2017
@jnsebgosselin
Copy link
Member

jnsebgosselin commented Oct 6, 2017

@ccordoba12
This issue is hard to reproduce. So far, I've been able to reproduce it only with the spyder-notebook:

1 - open spyder
2 - go to a notebook tab using the global file switcher (Ctrl+p).
3 - close all tabs of the notebook
4 - open the global file switcher again

Traceback (most recent call last):
  File "C:\Users\jsgosselin\spyder\spyder\app\mainwindow.py", line 2798, in open_fileswitcher
    self.fileswitcher.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

So far, I've been unable to reproduce this error with the Editor because I can't find a case when the Editor would allow to have no file opened. It always open a temp or untitled file, thus preventing this error to occur.

So what I can do is to implement a safeguard in the file switcher to handle the case when self.get_widget() returns None.

@ccordoba12 ccordoba12 added this to the v3.2.5 milestone Oct 6, 2017
@ccordoba12 ccordoba12 changed the title errores File switcher error Oct 6, 2017
@ccordoba12
Copy link
Member

So what I can do is to implement a safeguard in the file switcher to handle the case when self.get_widget() returns None.

Sure, I think it's the best solution. @dalthviz, what do think?

@dalthviz
Copy link
Member

dalthviz commented Oct 6, 2017

Yep I think is ok 👍 @ccordoba12, and thanks again @jnsebgosselin for all the good work in the Fileswitcher :)

@jnsebgosselin
Copy link
Member

Alright then, I'm going to work on this this weekend. Thanks for the feedback guys.

@ccordoba12
Copy link
Member

@jnsebgosselin, any updates on this one?

@jnsebgosselin
Copy link
Member

@ccordoba12 I'm going to work on this this week.

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

4 participants