ipython / ipython/ipykernel

echokernel example does not include topic in 'stream' responses

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

描述

I believe there is a bug in the [echokernel example kernel](http://jupyter-client.readthedocs.org/en/latest/wrapperkernels.html#example), specifically:

``` python
if not silent:
stream_content = {'name': 'stdout', 'text': code}
self.send_response(self.iopub_socket, 'stream', stream_content)
```

This is sending a message across the PUBSUB `iopub_socket`, but it doesn't include an `identity` argument, so there is no PUBSUB being prefixed to the message. The fix seems to be:

``` python
if not silent:
stream_content = {'name': 'stdout', 'text': code}
self.send_response(self.iopub_socket, 'stream', stream_content, ident=self._topic('stream'))
```

But I'm a tad hesitant to put it in a pull request because it seems intentional to make the `_topic` private. Does anyone know the right way to fix this?

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

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

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