aio-libs / aio-libs/aiologstash

Python 3.10 compatibility — the *loop* parameter was removed from Queue()

Abierto
#256 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
57
Forks
11
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Hello there!

There is an error while trying to create a Logstash handler (via `create_tcp_handler` coroutine) using Python 3.10.1:
```
Creation of the Logstash handler failed: As of 3.10, the *loop* parameter was removed from Queue() since it is no longer necessary
```

The error can be reproduced simply by running code from the Usage section of project's Readme file:
```
import asyncio
import logging

from aiologstash import create_tcp_handler

async def init_logger():
handler = await create_tcp_handler('elk', 10515)
root = logging.getLogger()
root.setLevel(logging.DEBUG)
root.addHandler(handler)

asyncio.run(init_logger())
```

Looks like we can fix this simply by removing the `loop` parameter here:
https://github.com/aio-libs/aiologstash/blob/3ee15ee2af005dd9cb0880e5a9fad960a85658d0/aiologstash/base_handler.py#L36
and other places where class `BaseLogstashHandler` is initiated. This is not so hard (even I can do it) but I guess some check for old Python versions is required — here things go a little bit complicated for me.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.