bmerry/birdisle-py

Python 3.8 deprecated explicit passing of loop parameter

Closed this issue · 2 comments

Affected versions:

Python 3.8.1, birdisle 0.1.3, aioredis 1.3.1

Steps to reproduce:

import birdisle.aioredis
import asyncio

asyncio.run(birdisle.aioredis.create_redis_pool())

Traceback:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
    asyncio.run(birdisle.aioredis.create_redis_pool())
  File "/usr/lib/python3.8/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 612, in run_until_complete
    return future.result()
  File "/usr/lib/python3.8/site-packages/birdisle/aioredis.py", line 133, in create_redis_pool
    pool = await create_pool(server, **kwargs)
  File "/usr/lib/python3.8/site-packages/birdisle/aioredis.py", line 122, in create_pool
    return await aioredis.create_pool(server, pool_cls=pool_cls, **kwargs)
  File "/usr/lib/python3.8/site-packages/aioredis/pool.py", line 58, in create_pool
    await pool._fill_free(override_min=False)
  File "/usr/lib/python3.8/site-packages/aioredis/pool.py", line 383, in _fill_free
    conn = await self._create_new_connection(self._address)
  File "/usr/lib/python3.8/site-packages/birdisle/aioredis.py", line 108, in _create_new_connection
    loop=self._loop)
AttributeError: 'ConnectionsPool' object has no attribute '_loop'

Problem:

With Python 3.8 the explicit passing of the loop parameter has been deprecated. This is reflected in the latest version of aioredis as the ConnectionPool class no longer has a _loop attribute. This causes birdisle.aioredis.ConnectionsPool to fail, because it explicitly passes the loop parameter when creating an aioredis ConnectionPool object.

I would give solving this myself a shot, but my python coroutine knowledge is still fairly basic, and I've had trouble setting up the development environment.

+1, also running into this issue.

I've fixed this in 0.2.0.