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

jupyter_server+nbclassic prevents open jupytext notebooks #991

Open
nthiery opened this issue Sep 8, 2022 · 2 comments
Open

jupyter_server+nbclassic prevents open jupytext notebooks #991

nthiery opened this issue Sep 8, 2022 · 2 comments

Comments

@nthiery
Copy link
Contributor

nthiery commented Sep 8, 2022

Brief steps to reproduce (can give further details upon request):

  • Install jupytext 1.14.1 and jupyter_server 1.18.1
  • launch jupyter server in a directory containing some markown jupytext notebook foo.md
  • navigate to http://127.0.0.1:8888/notebooks/foo.md

The notebook should open as a Jupyter notebook. Instead one is redirected to the text editor /edit/foo.md .

Cause: nbclassic's NotebookApp explicitly sets a hard redirect from /notebooks to /edit for non .ipynb files:
https://github.com/jupyter/nbclassic/blob/7752bd880122755c13273e0dad53fb66b8797f9b/nbclassic/notebookapp.py#L275

(context: we recently upgraded our hub, and the user servers now use jupyter_server; it's been a hard day of work to drill down to the cause!)

Not sure what the best fix would be. It presumably would require a change un jupyter_server. I hesitated
to post the issue there ...

Any suggestion for a workaround would be welcome. I am considering of monkey patching nbclassic.NotebookApp.#985

@nthiery
Copy link
Contributor Author

nthiery commented Sep 9, 2022

As a local temporary workaround, I replaced ipynb by (ipynb|md) in the nbclassic code:

RUN sed -i 's/ipynb/(ipynb|md)/' /opt/conda/lib/python3.9/site-packages/nbclassic/notebookapp.py

@nthiery
Copy link
Contributor Author

nthiery commented Sep 9, 2022

Hmm, this redirect does not break only jupytext notebooks, but anything that requires a specific handler.
E.g. images!
Cross posting to nbclassic.

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

No branches or pull requests

1 participant