ipython / ipython/ipykernel

echokernel example does not include topic in 'stream' responses

Aberta
#69 1 comentário 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
734
Forks
412
Merge médio
1d 5h
PRs com merge (30d)
8

Descrição

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?

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.