Skip to content

Widget interactions are not responding when blocking cell execution while interacting with widgets. #17360

@ghing

Description

@ghing

Environment data

  • VS Code version: 1.113.0
  • Jupyter Extension version (available under the Extensions sidebar): 2025.9.1
  • Python Extension version (available under the Extensions sidebar): 2026.4.0
  • OS (Windows | Mac | Linux distro) and version: macOS 26.3.1
  • Python and/or Anaconda version: 3.10.19
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Jupyter server running: Local
  • ipywidgets version: 8.1.8
  • jupyter-ui-poll version: 1.1.0

Expected behaviour

Running the quick example code from the jupyter-ui-poll README:

  • The button text is replaced with 👍.
  • "done" is displayed in the output below the cell.
  • Cell execution is completed.

Actual behaviour

  • Button text does not change
  • "done" is not displayed
  • Cell continues to execute

Steps to reproduce:

Using the quick example code from the jupyter-ui-poll README:

import time
from ipywidgets import Button
from jupyter_ui_poll import ui_events

# Set up simple GUI, button with on_click callback
# that sets ui_done=True and changes button text
ui_done = False
def on_click(btn):
    global ui_done
    ui_done = True
    btn.description = '👍'

btn = Button(description='Click Me')
btn.on_click(on_click)
display(btn)

# Wait for user to press the button
with ui_events() as poll:
    while ui_done is False:
        poll(10)          # React to UI events (up to 10 at a time)
        print('.', end='')
        time.sleep(0.1)
print('done')

Put this in a single cell in a Jupyter notebook.

Execute that cell.

Logs

Output for Jupyter in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Jupyter)

Note that the logs reflect logs after clearing existing logs and then restarting the kernel before executing the cell with the sample code. The Interrupt kernel execution and subsequent messages were displayed after clicking on the icon to stop execution of the cell after it would not respond to clicks on the button widget.

16:05:13.264 [info] Restart requested ~/workspace/my-project/processing/test_blocking_inputs.ipynb
16:05:13.406 [info] Process Execution: ~/workspace/my-project/.venv/bin/python -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
16:05:13.411 [info] Process Execution: ~/workspace/my-project/.venv/bin/python -m ipykernel_launcher --f=~/Library/Jupyter/runtime/kernel-v3445db8b8c1ad72503366b2053c1d6a2a776c9181.json
    > cwd: ~/workspace/my-project/processing
16:05:14.030 [info] Restarted f6b911f7-cea3-4bce-889b-cc2445e817e4
16:06:05.150 [info] Interrupt kernel execution
16:06:05.150 [info] Interrupt requested ~/workspace/my-project/processing/test_blocking_inputs.ipynb
16:06:05.150 [info] Interrupt kernel execution
16:06:05.150 [info] Interrupting kernel: my-project
16:06:05.150 [info] Interrupting kernel via SIGINT
16:06:05.472 [warn] Cell completed with errors (cancelled)
16:06:05.474 [info] Interrupt requested & sent for ~/workspace/my-project/processing/test_blocking_inputs.ipynb in notebookEditor.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugtriage-neededIssue needs to be triaged

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions