Closed almarklein closed 2 years ago
If I make the widget call these methods using with self._output
where the context is an ipywidgets.Output
, I can fix it for the notebook. For Jupyter Lab it makes prints and errors appear in-line for handle_event
, but for get_frame
everything is swallowed ...
For reference, I did something similar to what is suggested here: https://github.com/matplotlib/ipympl/issues/116
I agree it could be documented and that'd be a great first start. Would it be worth it to have the widget output include some option for including a stdout/stderr log in like a separate sub-widget or something? Eh probably not.
In Jupyter lab:
handle_event
are shown in the special log output.get_frame
are shown in the special log output, errors are swallowed.In Jupyter notebook:
handle_event
are shown.get_frame
are shown, but prints are swallowed (except when there is an error (??)).The difference in behavior between
handle_event
andget_frame
can be explained by the fact thathandle_event
is processed during a com event, whileget_frame
is called in a fresh asyncio task.This result surprises me quite a bit, since this is about basic prints and errors, and "Errors should never pass silently.". I guess async code is hard ... ?
I'm wondering whether this is something we should document or try to fix.