To be sure, the error message is 'Coroutine %r defined at %s:%s was never
yielded from' right? This comes from asyncio/tasks.py and the most likely
cause is that somewhere you write

    foo()

instead of

    yield from foo()

It's really unfortunate that you can't post your code, because I'm sure
that one look at it (or a few looks ;-) would tell me what's going on. Can
you at least post the traceback? Which exact Python and asyncio version are
you using? Is it happening at the end of the program or while the loop is
still running?


On Thu, Mar 27, 2014 at 2:23 AM, Florian Rüchel
<[email protected]>wrote:

> Hi everyone,
>
> I currently have a problem I cannot figure out. My code is running
> perfectly fine, but when using "PYTHONASYNCIODEBUG=1" it reports that a
> function was never yielded from per instance of that class I have. The
> problem is I cannot create an example that replicates the issue and the
> application is fairly large so maybe someone can give a hint on where I
> might go looking. The function in question is a method of a connection
> class. The class manages a TCP connection that has to send an init and a
> disconnect request. It is the disconnect method that is reported as never
> yielded from. I have log entries that prove that this function was actually
> run and I have tried wrapping it in asyncio.Task and asyncio.async and I
> also had a wrapping coroutine that *was *called and an explicit "yield
> from connection.disconnect()" statement.
>
> In all three cases the proper log entries were written and the server got
> the disconnect request, so I know it was properly executed. Now I am
> wondering if I have a bug in my application that is hidden somewhere
> between the layers that is repsonsible for this message. Or is it possible
> to trigger this error message even though the function was properly called?
>
> I'd also like to note that this is *the only* method where this happens,
> all other methods on all other classes are never reported as problematic.I
> have checked the method against others but I cannot find any difference at
> all: They are called with yield from or as tasks, they all use other
> coroutines (the connect and disconnect method actually both use *yield
> from self.talk(...)*) and they are all properly decorated.
>
> I'm sorry I cannot provide any code examples, but since I am unable to
> replicate the issue in a small sample, I fear I need further guidance on
> where to look for the issue.
>
> Many thanks in advance and Regards,
> Florian
>



-- 
--Guido van Rossum (python.org/~guido)

Reply via email to