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

Sage cannot open a Jupyter notebook directly #27463

Closed
egourgoulhon opened this issue Mar 11, 2019 · 18 comments
Closed

Sage cannot open a Jupyter notebook directly #27463

egourgoulhon opened this issue Mar 11, 2019 · 18 comments

Comments

@egourgoulhon
Copy link
Member

With Sage 8.6, it is possible to open directly a notebook file by

sage -n jupyter file_name.ipynb

With Sage 8.7.beta7 (Python 2 version), the same command yields

Please wait while the Sage Jupyter Notebook server starts...
[I 17:13:58.979 NotebookApp] Using MathJax: nbextensions/mathjax/MathJax.js
[I 17:13:59.177 NotebookApp] Serving notebooks from local directory: /home/eric/sage/8.7.develop
[I 17:13:59.177 NotebookApp] The Jupyter Notebook is running at:
[I 17:13:59.177 NotebookApp] http://localhost:8888/?token=fe7a048559fa30b3f0a47ca93f6974e4f658a98976e94f7f
[I 17:13:59.177 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
Traceback (most recent call last):
  File "/home/eric/sage/8.7.develop/src/bin/sage-notebook", line 267, in <module>
    launcher(unknown)
  File "/home/eric/sage/8.7.develop/src/bin/sage-notebook", line 99, in __init__
    main(argv)
  File "/home/eric/sage/8.7.develop/local/lib/python2.7/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/home/eric/sage/8.7.develop/local/lib/python2.7/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/home/eric/sage/8.7.develop/local/lib/python2.7/site-packages/notebook/notebookapp.py", line 1784, in start
    self.launch_browser()
  File "/home/eric/sage/8.7.develop/local/lib/python2.7/site-packages/notebook/notebookapp.py", line 1742, in launch_browser
    with open(fd, 'w', encoding='utf-8') as fh:
TypeError: coercing to Unicode: need string or buffer, int found

Upstream bug: jupyter/notebook#4303

Tarball: https://files.pythonhosted.org/packages/48/51/cb972122de1e1c8d5f1aea2aa39508556491babc303eb109dfa45f8244ee/notebook-5.7.6.tar.gz

Upstream: Completely fixed; Fix reported upstream

Component: packages: standard

Keywords: jupyter

Author: Jeroen Demeyer

Branch/Commit: 331990a

Reviewer: Eric Gourgoulhon

Issue created by migration from https://trac.sagemath.org/ticket/27463

@egourgoulhon

This comment has been minimized.

@jdemeyer
Copy link

Upstream: Not yet reported upstream; Will do shortly.

@jdemeyer
Copy link

comment:2

This is probably an upstream problem.

@egourgoulhon

This comment has been minimized.

@embray
Copy link
Contributor

embray commented Mar 12, 2019

comment:4

Note, this was probably introduced by #26969. We should probably downgrade the notebook package back down to 5.7.1 and/or provide a patch and/or open an issue upstream. We should also add a regression test for this to sage/tests/cmdline.py.

@jdemeyer
Copy link

comment:5

On my system, ./sage -n jupyter foo.ipynb works but it opens in a jupyterlab environment.

@jdemeyer
Copy link

Changed upstream from Not yet reported upstream; Will do shortly. to Completely fixed; Fix reported upstream

@jdemeyer

This comment has been minimized.

@jdemeyer
Copy link

Author: Jeroen Demeyer

@jdemeyer

This comment has been minimized.

@jdemeyer
Copy link

@jdemeyer
Copy link

Commit: 331990a

@jdemeyer
Copy link

New commits:

331990aUpgrade to notebook-5.7.6

@jdemeyer
Copy link

comment:10

Replying to @embray:

We should also add a regression test for this to sage/tests/cmdline.py.

I'm not sure how to do that. I don't think we should run an actual Jupyter server in the testsuite.

@egourgoulhon
Copy link
Member Author

Reviewer: Eric Gourgoulhon

@egourgoulhon
Copy link
Member Author

comment:11

Thanks for the fix! I've just checked it.

@embray
Copy link
Contributor

embray commented Mar 14, 2019

comment:12

Replying to @jdemeyer:

Replying to @embray:

We should also add a regression test for this to sage/tests/cmdline.py.

I'm not sure how to do that. I don't think we should run an actual Jupyter server in the testsuite.

I guess you're right; it doesn't seem worth the effort for what was an upstream bug anyways.

@vbraun
Copy link
Member

vbraun commented Mar 15, 2019

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

No branches or pull requests

4 participants