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

Notebook save failure #4564

Closed
juhasch opened this issue Nov 20, 2013 · 3 comments · Fixed by #4565
Closed

Notebook save failure #4564

juhasch opened this issue Nov 20, 2013 · 3 comments · Fixed by #4565
Assignees
Milestone

Comments

@juhasch
Copy link
Contributor

juhasch commented Nov 20, 2013

I can't save my notebook on master branch, if it contains this cell:

from IPython.display import Latex
display(Latex([1]))

I know Latex() should not be called like this, still this probably should not lead to a failure in saving the notebook.

@takluyver
Copy link
Member

Here's the error trying to save this:

2013-11-20 11:21:23.228 [NotebookApp] ERROR | Unhandled error in API request
Traceback (most recent call last):
  File "/home/takluyver/.local/lib/python3.3/site-packages/IPython/html/base/handlers.py", line 276, in wrapper
    result = method(self, *args, **kwargs)
  File "/home/takluyver/.local/lib/python3.3/site-packages/IPython/html/services/notebooks/handlers.py", line 197, in put
    self._save_notebook(model, path, name)
  File "/home/takluyver/.local/lib/python3.3/site-packages/IPython/html/services/notebooks/handlers.py", line 133, in _save_notebook
    model = self.notebook_manager.save_notebook_model(model, name, path)
  File "/home/takluyver/.local/lib/python3.3/site-packages/IPython/html/services/notebooks/filenbmanager.py", line 238, in save_notebook_model
    nb = current.to_notebook_json(model['content'])
  File "/home/takluyver/.local/lib/python3.3/site-packages/IPython/nbformat/v3/nbjson.py", line 49, in to_notebook
    return rejoin_lines(from_dict(d))
  File "/home/takluyver/.local/lib/python3.3/site-packages/IPython/nbformat/v3/rwbase.py", line 85, in rejoin_lines
    output[key] = _join_lines(item)
  File "/home/takluyver/.local/lib/python3.3/site-packages/IPython/nbformat/v3/rwbase.py", line 58, in _join_lines
    if lines and lines[0].endswith(('\n', '\r')):
AttributeError: 'int' object has no attribute 'endswith'

Either the classes, or the display protocol, or both, should probably be rejecting the data being provided as something that's not a string.

@ghost ghost assigned minrk Nov 20, 2013
@takluyver
Copy link
Member

@minrk is going to add checks in various places

@juhasch
Copy link
Contributor Author

juhasch commented Nov 21, 2013

Thanks for looking into this. @minrk : The new checks work for me.

@juhasch juhasch closed this as completed Nov 21, 2013
@minrk minrk added this to the 2.0 milestone Mar 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants