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

Leading slash in notebook paths breaks compatibility with other notebook extensions #444

Closed
caleblf opened this issue Feb 25, 2020 · 3 comments · Fixed by #445
Closed

Leading slash in notebook paths breaks compatibility with other notebook extensions #444

caleblf opened this issue Feb 25, 2020 · 3 comments · Fixed by #445
Milestone

Comments

@caleblf
Copy link

caleblf commented Feb 25, 2020

Without Jupytext installed, Jupyter notebook paths are stored in the session manager with the leading slash stripped. It appears that Jupytext instead stores notebook paths beginning with a leading slash. This doesn't cause any issues on its own, but I've run into an issue where other extensions can crash when attempting to get a session that doesn't exist. Specifically, I've seen this issue with appmode, which manages file paths directly, and assumes that the paths stored in the session manager don't have leading slashes.

To replicate, run a .ipynb notebook file with appmode and jupytext installed. Switch to App Mode and close the browser tab. Deletion fails with a 404 written to the server log, coming from get_session called on the session manager.

Environment:

  • python 3.8.1 (the incompatibility was also confirmed to occur on python 3.6)
  • jupyter 1.0.0
  • notebook 6.0.3
  • jupytext 1.3.4
  • appmode 0.7.0

I'm unsure if this is a bug in Jupytext or not, since I haven't yet been able to find the place in the code where the leading slash is introduced. Is this behavior intended?

@mwouts
Copy link
Owner

mwouts commented Feb 26, 2020

Hello @Iguanotron , thanks for your precise report, that's very helpful. I remember seeing duplicated paths for the same notebook (one with the leading slash, one without) in the running notebook tab, that may be related to what you report. Anyway I will have a look!

@mwouts mwouts added this to the 1.4.0 milestone Feb 26, 2020
@mwouts
Copy link
Owner

mwouts commented Feb 27, 2020

@Iguanotron , I think I have a fix for this at #445 . Would you like to give it a try?

git clone -b remove_leading_slash https://github.com/mwouts/jupytext
cd jupytext
python setup.py sdist bdist_wheel
pip install dist/jupytext-1.3.4+dev.tar.gz

Thanks!

@caleblf
Copy link
Author

caleblf commented Mar 4, 2020

That fix works for me in my environment (as described above)! Thanks!

@mwouts mwouts modified the milestones: 1.4.0, 1.3.5 Mar 7, 2020
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