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

Error when attempting to close a split panel in the editor window #4843

Closed
csabella opened this issue Jul 28, 2017 · 20 comments
Closed

Error when attempting to close a split panel in the editor window #4843

csabella opened this issue Jul 28, 2017 · 20 comments

Comments

@csabella
Copy link
Contributor

Description

What steps will reproduce the problem?

  1. In the editor, I have used 'split vertically' to have source on the top and bottom. The split screen works fine.
  2. On the bottom (second panel), I click on the gears icon to close to the panel and I get a popup error message suggesting to submit to github.

What is the expected output? What do you see instead?
I expect to get a pop-up menu with the option to close the panel. What I see instead is an error window suggesting to submit the bug to github. The outcome is that I can't close the split panel unless I restart Spyder.

Please provide any additional information below

File "/usr/local/lib/python3.5/dist-packages/spyder/widgets/editor.py", line 1236, in __setup_menu
add_actions(self.menu, list(actions)+self.__get_split_actions())
File "/usr/local/lib/python3.5/dist-packages/spyder/utils/qthelpers.py", line 309, in add_actions
action = action.no_icon_action
File "/usr/local/lib/python3.5/dist-packages/spyder/utils/qthelpers.py", line 443, in getattribute
attr = super(SpyderAction, self).getattribute(name)
File "/usr/local/lib/python3.5/dist-packages/spyder/utils/qthelpers.py", line 462, in no_icon_action
return self._action_no_icon
File "/usr/local/lib/python3.5/dist-packages/spyder/utils/qthelpers.py", line 445, in getattribute
if hasattr(attr, 'call') and name not in ['triggered', 'toggled',
RuntimeError: wrapped C/C++ object of type SpyderAction has been deleted

Version and main components

  • Spyder Version: 3.2.0
  • Python Version: 3.5.2
  • Qt Versions: 4.8.7, PyQt4 (API v2) 4.11.4 on Linux

Dependencies

pyflakes >=0.6.0 :  1.5.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pygments >=2.0   :  2.2.0 (OK)
pandas >=0.13.1  :  0.20.1 (OK)
numpy >=1.7      :  1.12.1 (OK)
sphinx >=0.6.6   :  1.6.3 (OK)
rope >=0.9.4     :  0.10.5 (OK)
jedi >=0.9.0     :  0.10.2 (OK)
psutil >=0.3     :  5.2.2 (OK)
nbconvert >=4.0  :  5.2.1 (OK)
sympy >=0.7.3    :  None (NOK)
cython >=0.21    :  None (NOK)
qtconsole >=4.2.0:  4.3.0 (OK)
IPython >=4.0    :  6.1.0 (OK)
pylint >=0.25    :  1.7.2 (OK)

@ccordoba12
Copy link
Member

Thanks for reporting. We'll try to fix this as soon as possible.

@andfoy, please try to fix this error for 3.2.1. It shouldn't be that hard :-)

@andfoy
Copy link
Member

andfoy commented Jul 31, 2017

@csabella I can't reproduce this one, does it always happens?

@csabella
Copy link
Contributor Author

@andfoy Yes, I think it always happens. Before I upgraded to 3.2.0, it hadn't happened at all. If I close Spyder and reopen it, then I'm able to close the panel without an issue. Just to clarify, I get the error when clicking on the gears for the new panel, not for the existing panel. I've also clicked on 'New Window' and get the same error on the gears menu on the new window.

I don't know if this is helpful, but when I say 'gears', I'm referring to the icon that's at the top right of the editor window. Clicking on it gives a menu of 'Go to line', 'Set console working directory', 'Show in external file explorer', 'File switcher', 'Find symbols in files', etc.

Thanks!

@andfoy
Copy link
Member

andfoy commented Jul 31, 2017

By the way, what is your Operating System?

@andfoy
Copy link
Member

andfoy commented Jul 31, 2017

I cannot reproduce this one on Linux with Qt 5.5, 5.6, 5.7 and 5.8

@csabella
Copy link
Contributor Author

Ubuntu 16.04. In the dump, it reported this: Qt Versions: 4.8.7, PyQt4 (API v2) 4.11.4 on Linux. Should I try to update Qt? If so, how would I do that?

@andfoy
Copy link
Member

andfoy commented Jul 31, 2017

You can upgrade using apt: apt install qt5-default. Or you can install Qt wheels directly from PyPi using pip: pip install -U pyqt5

@rlaverde
Copy link
Member

It happens to me when splitting it horizontally, and trying to click in the new split options (gear icon)

@andfoy
Copy link
Member

andfoy commented Jul 31, 2017

Yes! Finally I could reproduce it

@andfoy
Copy link
Member

andfoy commented Jul 31, 2017

It seems that catching the RuntimeError does the trick

@csabella
Copy link
Contributor Author

LOL. After I upgraded to pyqt5, I couldn't start Spyder anymore. Trying from the command line, I was getting a seg fault error in both Spyder2 and Spyder3. I uninstalled and reinstalled several times, but couldn't get past it, so something got fubar'ed. I'm glad you were able to recreate the issue, but I won't be able to confirm the patch. :-(

In order to get something going, I created a venv under 3.5 and installed the in-development version of Spyder. I was able to start that, but now I can't even split the editor window at all. :-( It gives a different error.

I tried installing Spyder in a 3.6 venv, but it didn't work. Should it have worked or will it only work up to 3.5?

Thanks!

@andfoy
Copy link
Member

andfoy commented Jul 31, 2017

I would recommend to install Anaconda to prevent such Qt dependency conflicts, the following links may serve as a guide to installation:

With respect to the patch, I tested it against Python 3.6 and Qt 5.8, so it should be valid also on 3.5 and any lower Qt version.

@andfoy
Copy link
Member

andfoy commented Jul 31, 2017

It gives a different error.

What is the new error?

@csabella
Copy link
Contributor Author

File "/home/cheryl/spyder/spyder/widgets/editor.py", line 2242, in
lambda: self.split(orientation=Qt.Vertical))
File "/home/cheryl/spyder/spyder/widgets/editor.py", line 2303, in split
unregister_editorstack_cb=self.unregister_editorstack_cb)
File "/home/cheryl/spyder/spyder/widgets/editor.py", line 2237, in init
self.register_editorstack_cb(self.editorstack)
File "/home/cheryl/spyder/spyder/plugins/editor.py", line 1241, in register_editorstack
editorstack.set_outlineexplorer(self.outlineexplorer)
File "/home/cheryl/spyder/spyder/widgets/editor.py", line 844, in set_outlineexplorer
self.outlineexplorer.is_visible.connect(self._refresh_outlineexplorer)
AttributeError: 'OutlineExplorer' object has no attribute 'is_visible'

@andfoy
Copy link
Member

andfoy commented Jul 31, 2017

@csabella Are you using the master revision branch or are you using the 3.x one?

@csabella
Copy link
Contributor Author

It defaulted to the master branch.

@csabella
Copy link
Contributor Author

Thank you for all your help with this. I wish I hadn't lost my old copy when I updated Qt, but I'm glad to be able to run Spyder with 3.6 with Anaconda. I'll probably look at the dev version more too.

@andfoy
Copy link
Member

andfoy commented Jul 31, 2017

I'm glad to hear you can run Spyder once again! Can you give a test to the patch on PR #4869?

@csabella
Copy link
Contributor Author

I've been running this for a few weeks now and I haven't gotten the error message again, so I believe the patch worked. Sorry I didn't reply sooner, but I couldn't recreate the issue, so I wanted to make sure it wouldn't happen again through regular usage. Thanks!

@ccordoba12
Copy link
Member

No problem, thanks for letting us know about it.

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