ipython / ipython/ipykernel

Should initialization errors be exposed to the user?

Offen
#1,408 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
734
Forks
412
Ø Merge
1 T. 5 Std.
Gemergte PRs (30 T.)
8

Beschreibung

Currently, if user configures `InteractiveShellApp.exec_lines` and it fails, there is no way for them to see the error in notebook.

For example set `c.InteractiveShellApp.exec_lines=["raise ValueError()"]`.

This is visible in IPython/jupyter-server because it gets written to the terminal, but it does not show up in the notebook. There is even explicit code making sure that it won't be attached to the output of the first cell once it gets run:

https://github.com/ipython/ipykernel/blob/84211d7227fd5faa9d6e485641c1a4df6e7df2b4/ipykernel/kernelapp.py#L730-L737

With code to the same effect in IPython itself: https://github.com/ipython/ipython/blob/cc614bdc1d3f61303e265c26d593d384e4a90d1e/IPython/core/shellapp.py#L341-L360

I wonder if we should emit a special message for any output so that it would be shown in the Notebook console? The same way as unhandled ipywidget messages land in the console?

I mean this log console:

Image

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.