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

AttributeError: Nonetype has no attribute "clear" when right clicking in the empty project explorer with no project open #6975

Closed
dc-avasilev opened this issue Apr 17, 2018 · 5 comments

Comments

@dc-avasilev
Copy link

dc-avasilev commented Apr 17, 2018

File "/usr/local/anaconda3/lib/python3.6/site-packages/spyder/widgets/explorer.py", line 480, in contextMenuEvent
    self.update_menu()
  File "/usr/local/anaconda3/lib/python3.6/site-packages/spyder/widgets/explorer.py", line 458, in update_menu
    self.menu.clear()
AttributeError: 'NoneType' object has no attribute 'clear'

click right button on mouse in cleared project manager window

@CAM-Gerlach
Copy link
Member

Yup, was able to reproduce. Specifically, the window was "cleared" by closing the current project, then reopening it from the menu. @ccordoba12 , do we want to just catch the error and pass (or otherwise better handle it), or go further and disable opening the project explorer when no project is open, since it serves no real purpose?

@CAM-Gerlach CAM-Gerlach changed the title project manager window crash AttributeError: Nonetype has no attribute "clear" when right clicking in the empty project explorer with no project open Apr 17, 2018
@CAM-Gerlach
Copy link
Member

CAM-Gerlach commented Apr 17, 2018

Also, I get a series of followup errors:

  File "C:\Anaconda3\lib\site-packages\qtconsole\console_widget.py", line 420, in eventFilter
    event.button() == QtCore.Qt.MidButton and \
AttributeError: 'QContextMenuEvent' object has no attribute 'button'

Which continue until I tell it to hide the error dialog for future errors (or presumably restart spyder).

@ccordoba12
Copy link
Member

do we want to just catch the error and pass

Yep, I think it's the easiest thing to do.

or go further and disable opening the project explorer when no project is open, since it serves no real purpose?

There's no harm in showing the project explorer empty.

Also, I get a series of followup errors

This is odd. I don't know why those errors are generated.

@CAM-Gerlach CAM-Gerlach self-assigned this Apr 18, 2018
@CAM-Gerlach
Copy link
Member

Okay, cool. I'll get to it Soon™

@ccordoba12 ccordoba12 assigned dalthviz and unassigned CAM-Gerlach May 19, 2018
@ccordoba12
Copy link
Member

@dalthviz, please work on this one by catching AttributeError in the right places.

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