aio-libs / aio-libs/aiomysql

AttributeError: '_UnixSelectorEventLoop' object has no attribute 'create_future'

Open
#478 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
1.9k
Forks
272
PR merge metrics
No merged PRs in 30d

Description

Just run example_pool.py
**Versions:**
(1) Python 3.5.0
(2)asyncio 3.4.3
(3)aiomysql: 0.0.20

**Error Stack info:**
Traceback (most recent call last):
File "example_pool.py", line 10, in test_example
async with conn.cursor() as cur:
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/aiomysql/connection.py", line 418, in cursor
fut = self._loop.create_future()
AttributeError: '_UnixSelectorEventLoop' object has no attribute 'create_future'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "example_pool.py", line 20, in
loop.run_until_complete(test_example(loop))
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/base_events.py", line 342, in run_until_complete
return future.result()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/futures.py", line 274, in result
raise self._exception
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(value)
File "example_pool.py", line 14, in test_example
assert r == 42
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/aiomysql/utils.py", line 103, in __aexit__
await self._pool.release(self._conn)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/aiomysql/pool.py", line 197, in release
fut = self._loop.create_future()
AttributeError: '_UnixSelectorEventLoop' object has no attribute 'create_future'
Exception ignored in: >
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/aiomysql/connection.py", line 1072, in __del__
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/aiomysql/connection.py", line 298, in close
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/selector_events.py", line 566, in close
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/base_events.py", line 453, in call_soon
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/base_events.py", line 462, in _call_soon
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/base_events.py", line 289, in _check_closed
RuntimeError: Event loop is closed

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.