python / asyncio

asyncio historical repository
https://docs.python.org/3/library/asyncio.html
1.04k stars 177 forks source link

Asyncio AttributeError and TypeError raised #375

Closed hegusung closed 8 years ago

hegusung commented 8 years ago

Hi, I got a piece of code using asyncio which runs pretty well, however under certain circomstances (I didn't manage to discover which ones) these errors are raised :

Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 728, in callback
    futures._chain_future(ensure_future(coro, loop=loop), future)
  File "/usr/lib/python3.5/asyncio/futures.py", line 421, in _chain_future
    raise TypeError('A future is required for destination argument')
TypeError: A future is required for destination argument

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/events.py", line 125, in _run
    self._callback(*self._args)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 730, in callback
    if future.set_running_or_notify_cancel():
AttributeError: 'Condition' object has no attribute 'set_running_or_notify_cancel'

Any idea what is causing this ?

gvanrossum commented 8 years ago

Looks like a bug in your code. Maybe you are not heeding the warnings about mixing threads and tasks. If you need help try the python-tulip list or find some other forum, sorry.