Skip to content

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

Open
@MrBigBang

Description

@MrBigBang

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: <bound method Connection.del of <aiomysql.connection.Connection object at 0x103b20908>>
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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions