[issue21209] q.put(some_tuple) fails when PYTHONASYNCIODEBUG=1

Guido van Rossum report at bugs.python.org
Sun Apr 13 22:43:35 CEST 2014


Guido van Rossum added the comment:

I'll be darned. It appears that generator's send() method uses METH_O, which means that it really expects a single argument, but if you pass it a tuple, it assumes that you meant each item in the tuple as a separate argument. I think a more correct fix is attached -- don't add a dummy *args to the send() method, but call self.gen.send((value,)).

I'd like to fix this upstream and add some tests first; also see http://code.google.com/p/tulip/issues/detail?id=163 (which touches upon a different problem in CoroWrapper not emulating the real generator object well enough).

----------
assignee:  -> gvanrossum
keywords: +patch
Added file: http://bugs.python.org/file34805/gen_send.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21209>
_______________________________________


More information about the Python-bugs-list mailing list