Tests of nbclient fail with the latest ipykernel. I'm not sure why yet but it seems that the latest ipykernel does not respect raises-exception cell tag and stops executing. I'm using this notebook from nbclient tests to reproduce the issue.
The first cell has the mentioned tag so the raised exception should not stop the execution and the second cell should be executed as well. This is true with ipykernel 5.4.3, where the notebook after the execution looks like this:
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"execution": {
"iopub.execute_input": "2021-02-24T09:28:28.153788Z",
"iopub.status.busy": "2021-02-24T09:28:28.152885Z",
"iopub.status.idle": "2021-02-24T09:28:28.200714Z",
"shell.execute_reply": "2021-02-24T09:28:28.200111Z"
},
"tags": [
"raises-exception"
]
},
"outputs": [
{
"ename": "Exception",
"evalue": "message",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mException\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-1-644b5753a261>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# üñîçø∂é\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mException\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"message\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mException\u001b[0m: message"
]
}
],
"source": [
"# üñîçø∂é\n",
"raise Exception(\"message\")"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"execution": {
"iopub.execute_input": "2021-02-24T09:28:28.308682Z",
"iopub.status.busy": "2021-02-24T09:28:28.307285Z",
"iopub.status.idle": "2021-02-24T09:28:28.313628Z",
"shell.execute_reply": "2021-02-24T09:28:28.312340Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok\n"
]
}
],
"source": [
"print('ok')"
]
}
],
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.2"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
but with the latest version, the second cell is not executed:
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"execution": {
"iopub.execute_input": "2021-02-24T09:44:49.786558Z",
"iopub.status.busy": "2021-02-24T09:44:49.786002Z",
"iopub.status.idle": "2021-02-24T09:44:49.831791Z",
"shell.execute_reply": "2021-02-24T09:44:49.831305Z"
},
"tags": [
"raises-exception"
]
},
"outputs": [
{
"ename": "Exception",
"evalue": "message",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mException\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-1-644b5753a261>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# üñîçø∂é\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mException\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"message\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mException\u001b[0m: message"
]
}
],
"source": [
"# üñîçø∂é\n",
"raise Exception(\"message\")"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"execution": {
"iopub.status.busy": "2021-02-24T09:44:49.833859Z",
"iopub.status.idle": "2021-02-24T09:44:49.834236Z",
"shell.execute_reply": "2021-02-24T09:44:49.833506Z"
}
},
"outputs": [],
"source": [
"print('ok')"
]
}
],
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.2"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
I'm not sure yet where the root cause is laying. Any help appreciated.
Tests of nbclient fail with the latest ipykernel. I'm not sure why yet but it seems that the latest ipykernel does not respect
raises-exceptioncell tag and stops executing. I'm using this notebook from nbclient tests to reproduce the issue.The first cell has the mentioned tag so the raised exception should not stop the execution and the second cell should be executed as well. This is true with ipykernel 5.4.3, where the notebook after the execution looks like this:
but with the latest version, the second cell is not executed:
I'm not sure yet where the root cause is laying. Any help appreciated.