Skip to content

IPykernel v7 breaks this package: IndexError in the stack #121

@jeertmans

Description

@jeertmans

Hi! When trying to upgrade my project dependencies, I noticed the following error when displaying content using VisPY (and jupyter_rfb) inside Jupyter notebooks:

Traceback (most recent call last):
  File "/export/home/eertmans/repositories/DiffeRT/DiffeRT/.venv/lib/python3.11/site-packages/jupyter_rfb/widget.py", line 265, in _rfb_maybe_draw
    array = self.get_frame()
            ^^^^^^^^^^^^^^^^
  File "/export/home/eertmans/repositories/DiffeRT/DiffeRT/.venv/lib/python3.11/site-packages/vispy/app/backends/_jupyter_rfb.py", line 191, in get_frame
    self._vispy_canvas.context.flush_commands()
  File "/export/home/eertmans/repositories/DiffeRT/DiffeRT/.venv/lib/python3.11/site-packages/vispy/gloo/context.py", line 172, in flush_commands
    self.glir.flush(self.shared.parser)
  File "/export/home/eertmans/repositories/DiffeRT/DiffeRT/.venv/lib/python3.11/site-packages/vispy/gloo/glir.py", line 584, in flush
    self._shared.flush(parser)
  File "/export/home/eertmans/repositories/DiffeRT/DiffeRT/.venv/lib/python3.11/site-packages/vispy/gloo/glir.py", line 506, in flush
    parser.parse(self._filter(self.clear(), parser))
  File "/export/home/eertmans/repositories/DiffeRT/DiffeRT/.venv/lib/python3.11/site-packages/vispy/gloo/glir.py", line 824, in parse
    self._parse(command)
  File "/export/home/eertmans/repositories/DiffeRT/DiffeRT/.venv/lib/python3.11/site-packages/vispy/gloo/glir.py", line 800, in _parse
    ob.set_framebuffer(*args)
  File "/export/home/eertmans/repositories/DiffeRT/DiffeRT/.venv/lib/python3.11/site-packages/vispy/gloo/glir.py", line 1760, in set_framebuffer
    self.deactivate()
  File "/export/home/eertmans/repositories/DiffeRT/DiffeRT/.venv/lib/python3.11/site-packages/vispy/gloo/glir.py", line 1774, in deactivate
    gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, stack[-1])
                                            ~~~~~^^^^
IndexError: list index out of range

The error is raised as soon as we try to interact with the viewer (that only shows a black image).

Image

After digging a bit, I could identify that the bug was caused when upgrading IPykernel to v7.0.0 (or above).

I looked at their changelog, and I am not sure what would cause this bug.

Any idea how to fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions