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

Using native menu actions of the notebook as 'Rename' its a point of failures #133

Closed
ccordoba12 opened this issue Oct 30, 2017 · 5 comments
Assignees

Comments

@ccordoba12
Copy link
Member

@ehiverson commented on Sun Oct 29 2017

Description

I've experienced some odd behavior lately on Spyder. This particular problem was from closing a notebook that I had renamed using File -> Rename. However, after doing that action, the name represented by the tab did not change. And upon closing the window there is a FileNotFoundError.
What steps will reproduce the problem?

  1. Rename a notebook ( action not reflected by the name displayed in the tab)
  2. close the tab

What is the expected output? What do you see instead?
I'd expect the tab to close, but instead it gives this error.

Please provide any additional information below

File "c:\users\erik\appdata\local\programs\python\python35-32\lib\site-packages\spyder_notebook\notebookplugin.py", line 359, in close_client
nb_contents = nbformat.read(path, as_version=4)
File "c:\users\erik\appdata\local\programs\python\python35-32\lib\site-packages\nbformat_init_.py", line 138, in read
with io.open(fp, encoding='utf-8') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\Erik\Documents\Education\Data Science\Untitled.ipynb'

Version and main components

  • Spyder Version: 3.2.4
  • Python Version: 3.5.2
  • Qt Versions: 5.7.1, PyQt5 5.7.1 on Windows

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.20.3 (OK)
numpy >=1.7      :  1.13.3 (OK)
sphinx >=0.6.6   :  1.6.5 (OK)
rope >=0.9.4     :  0.10.7 (OK)
jedi >=0.9.0     :  0.11.0 (OK)
nbconvert >=4.0  :  5.3.1 (OK)
sympy >=0.7.3    :  None (NOK)
cython >=0.21    :  0.27.2 (OK)
qtconsole >=4.2.0:  4.3.1 (OK)
IPython >=4.0    :  6.2.1 (OK)
pylint >=0

---

@ccordoba12 commented on [Mon Oct 30 2017](https://github.com/spyder-ide/spyder/issues/5605#issuecomment-340459726)

Thanks for reporting. I'm moving this issue to our spyder-notebook repo because it belongs there.

@dalthviz
Copy link
Member

dalthviz commented Nov 2, 2017

Hi @ehiverson using some options that are given by the original notebook menu are not supported. If you want to rename the notebook, you should save a new notebook using the plugin's toolbutton (:gear:) without using previously the rename option (maybe we could implement a rename action available from the toolbutton).

@ccordoba12 what we should do about that kind of actions that trigger changes in the file system from the notebook's 'native' menu?, Should we try to create actions for them that the plugin could handle?

@dalthviz dalthviz changed the title rename and then close notebook Using native menu actions of the noteboook as 'Rename' causes errors Nov 2, 2017
@dalthviz dalthviz changed the title Using native menu actions of the noteboook as 'Rename' causes errors Using native menu actions of the notebook as 'Rename' its a point of failures Nov 2, 2017
@ccordoba12
Copy link
Member Author

That's quite hard. We should try to disable them, but I don't know how...

@andfoy
Copy link
Member

andfoy commented Nov 2, 2017

Sorry for involving myself here, but isn't there any way of intercepting the DOM and modify it to prevent showing this menu?

@dalthviz
Copy link
Member

dalthviz commented Nov 2, 2017

You are right @andfoy 👍

Note: this could be helpful here: https://stackoverflow.com/a/18414401

@dalthviz dalthviz self-assigned this Nov 2, 2017
@dalthviz dalthviz added this to the v0.2 milestone Nov 2, 2017
@jitseniesen jitseniesen modified the milestones: v0.2.0, v0.3.0 Dec 17, 2019
@goanpeca goanpeca added the v0.3 label Feb 23, 2020
@goanpeca goanpeca removed this from the v0.3.0 milestone Feb 23, 2020
@jitseniesen
Copy link
Member

After PR #264, it is no longer possible to rename from within the notebook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants