Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env python
"""
When PYTHONASYNCIODEBUG is set to 1, this causes a strange error:
TypeError: send() takes 2 positional arguments but 7 were given
Invoke as follows:
$ PYTHONASYNCIODEBUG=1 python3 put_get_bug.py
Note that os.environ["PYTHONASYNCIODEBUG"] = "1" doesn't work.
"""
import asyncio
import os
def t1(q):
yield from asyncio.sleep(0.5)
q.put_nowait((0, 1, 2, 3, 4, 5))
def t2(q):
v = yield from q.get()
print(v)
q = asyncio.Queue()
asyncio.get_event_loop().run_until_complete(asyncio.wait([t1(q), t2(q)]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.