websocket doesn't filter by streams
- Langage dominant
- Python
- Étoiles
- 537
- Forks
- 118
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
## Long story short
`websocket` doesn't filter by stream as args would suggest.
https://github.com/aio-libs/aiodocker/blob/f1dbdc3d42147f4c2ab5e6802acf6f7d0f885be4/aiodocker/containers.py#L239
```py
async def websocket(self, **params):
if not params:
params = {"stdin": True, "stdout": True, "stderr": True, "stream": True}
...
```
* Expected behaviour:
```py
ws_out = await proc.websocket(stdin=False, stdout=True, stderr=False, stream=True)
ws_err = await proc.websocket(stdin=False, stdout=False, stderr=True, stream=True)
# proc prints "foobar" to stdout
msg = await ws_out.receive() # msg.data == b"foobar"
msg = await ws_err.receive() # msg.data != b"foobar"
```
* Actual behaviour:
```py
msg = await ws_err.receive() # msg.data == b"foobar"
```
## How to reproduce
Get/Build a docker image that prints anything to stdout. Then
```py
docker = aiodocker.Docker()
proc = await docker.containers.create_or_replace(name, config)
ws_out = await proc.websocket(stdin=False, stdout=True, stderr=False, stream=True)
ws_err = await proc.websocket(stdin=False, stdout=False, stderr=True, stream=True)
await proc.start()
print(await ws_err.receive())
```
## Your environment
Linux
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.