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 500 while saving IPython notebook #3360

Closed
kmike opened this issue May 26, 2013 · 2 comments · Fixed by #3370
Closed

Error 500 while saving IPython notebook #3360

kmike opened this issue May 26, 2013 · 2 comments · Fixed by #3370
Assignees
Milestone

Comments

@kmike
Copy link
Contributor

kmike commented May 26, 2013

Hi,

I've created a notebook using IPython master and Python 3.3, then opened and changed it in 'ipython notebook' using IPython master and Python 2.7. Now I can't save changes because IPython raises the following exception:

Traceback (most recent call last):
  File "/Users/kmike/envs/scraping/lib/python2.7/site-packages/tornado/web.py", line 1077, in _execute
    *self.path_args, **self.path_kwargs)
  File "/Users/kmike/envs/scraping/lib/python2.7/site-packages/tornado/web.py", line 1892, in wrapper
    return method(self, *args, **kwargs)
  File "/Users/kmike/envs/scraping/lib/python2.7/site-packages/IPython/frontend/html/notebook/handlers.py", line 672, in put
    nbm.save_notebook(notebook_id, self.request.body, name=name, format=format)
  File "/Users/kmike/envs/scraping/lib/python2.7/site-packages/IPython/frontend/html/notebook/nbmanager.py", line 168, in save_notebook
    self.write_notebook_object(nb, notebook_id)
  File "/Users/kmike/envs/scraping/lib/python2.7/site-packages/IPython/frontend/html/notebook/filenbmanager.py", line 175, in write_notebook_object
    old_checkpoints = self.list_checkpoints(notebook_id)
  File "/Users/kmike/envs/scraping/lib/python2.7/site-packages/IPython/frontend/html/notebook/filenbmanager.py", line 313, in list_checkpoints
    path = self.get_checkpoint_path(notebook_id, checkpoint_id)
  File "/Users/kmike/envs/scraping/lib/python2.7/site-packages/IPython/frontend/html/notebook/filenbmanager.py", line 277, in get_checkpoint_path
    return self.get_checkpoint_path_by_name(name, checkpoint_id)
  File "/Users/kmike/envs/scraping/lib/python2.7/site-packages/IPython/frontend/html/notebook/filenbmanager.py", line 269, in get_checkpoint_path_by_name
    ext=self.filename_ext,
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-8: ordinal not in range(128)
@kmike
Copy link
Contributor Author

kmike commented May 26, 2013

Notebook title has non-ASCII characters. Changing it to be ASCII-only makes save work.

@ghost ghost assigned minrk May 27, 2013
minrk added a commit to minrk/ipython that referenced this issue May 28, 2013
used in comparison check for notebook name change.

Unless the filenames are normalized,
unchanged names may result in false positives for a name change
(e.g. OS X uses NFD on the filesystem,
so u'\xfc' roundtripped to the filesystem will be u'u\u0308'),
which can result in the first save of a notebook after open performing the following actions:

1. save the recently opened notebook
2. `old_name != new_name`, so name change detected
3. delete old_name (which is actually new_name), which ultimately deletes the just-saved notebook

In master, this has a symptom of the first checkpoint failing because the first save actually deleted the file, and you can't checkpoint a notebook that doesn't exist.

closes ipython#3360
@minrk
Copy link
Member

minrk commented May 28, 2013

try #3370

Carreau added a commit that referenced this issue Jun 2, 2013
used in comparison check for notebook name change.

Unless the filenames are normalized, unchanged names may result in false positives for a name change (e.g. OS X uses NFD on the filesystem, so u'\xfc' roundtripped to the filesystem will be u'u\u0308'), which can result in the first save of a notebook after open performing the following actions:

save the recently opened notebook
old_name != new_name, so name change detected
delete old_name (which is actually new_name), which ultimately deletes the just-saved notebook
In master, this has a symptom of the first checkpoint failing because the first save actually deleted the file, and you can't checkpoint a notebook that doesn't exist.

closes #3360
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
used in comparison check for notebook name change.

Unless the filenames are normalized,
unchanged names may result in false positives for a name change
(e.g. OS X uses NFD on the filesystem,
so u'\xfc' roundtripped to the filesystem will be u'u\u0308'),
which can result in the first save of a notebook after open performing the following actions:

1. save the recently opened notebook
2. `old_name != new_name`, so name change detected
3. delete old_name (which is actually new_name), which ultimately deletes the just-saved notebook

In master, this has a symptom of the first checkpoint failing because the first save actually deleted the file, and you can't checkpoint a notebook that doesn't exist.

closes ipython#3360
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
used in comparison check for notebook name change.

Unless the filenames are normalized, unchanged names may result in false positives for a name change (e.g. OS X uses NFD on the filesystem, so u'\xfc' roundtripped to the filesystem will be u'u\u0308'), which can result in the first save of a notebook after open performing the following actions:

save the recently opened notebook
old_name != new_name, so name change detected
delete old_name (which is actually new_name), which ultimately deletes the just-saved notebook
In master, this has a symptom of the first checkpoint failing because the first save actually deleted the file, and you can't checkpoint a notebook that doesn't exist.

closes ipython#3360
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.

2 participants