ipython / ipython/ipykernel

KeyboardInterrupt not producing a failed request

未關閉
#845 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
734
分支
412
平均合併
1 天 5 小時
30 天內合併 PR
8

描述

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?

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。