ipython / ipython/ipykernel

KeyboardInterrupt not producing a failed request

Ouverte
#845 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
734
Forks
412
Merge moyen
1 j 5 h
PR mergées (30 j)
8

Description

One test in nbclient [fails randomly](https://github.com/jupyter/nbclient/issues/189#issuecomment-1013762525) while executing a cell with:
```python
while True:
pass
```
And interrupting the execution.
Instead of having the following output:
```
[{
'ename': 'KeyboardInterrupt',
'evalue': '',
'output_type': 'error',
'traceback': ['---------------------------------------------------------------------------',\n 'KeyboardInterrupt Traceback (most '\n 'recent call last)',\n ' in \n----> 1 while True: continue\n',\n 'KeyboardInterrupt: ']
}]
```
We sometimes get:
```
[{
'name': 'stderr',
'output_type': 'stream',
'text': '\nKeyboardInterrupt\n\n'
}]
```
Which means the interrupt is not treated as an error in the sense of a failed request. Instead, the `KeyboardInterrupt` is just streamed on `stderr`.
I'm not sure it comes from ipykernel, and I cannot reproduce locally. Any idea what could be the cause of this behavior?

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.