jupyter / nbgrader

A system for assigning and grading notebooks
https://nbgrader.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.3k stars 317 forks source link

Validate button shows incomprehensible SyntaxError when the solution trips the timeout limit #1846

Open lahwaacz opened 1 year ago

lahwaacz commented 1 year ago

Operating system

Arch Linux

nbgrader --version

Python version 3.11.5 (main, Sep  2 2023, 14:16:33) [GCC 13.2.1 20230801]
nbgrader version 0.9.1

jupyterhub --version (if used with JupyterHub)

4.0.2

jupyter notebook --version

7.0.6

Expected behavior

Nbgrader should not display a SyntaxError when some internal operation fails.

Actual behavior

When a student tries to validate an assignment that gets stuck due to infinite loop, Nbgrader shows this error:

Validation failed
Cannot validate: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

screenshot-2023-11-22@12:08:02

Steps to reproduce the behavior

Create an assignment with an infinite loop and click on "Validate":

while True:
    pass
brichet commented 11 months ago

On my side the test passes... and I don't think this is expected :smile:

It should fail if the execution timeout.