uvloop icon indicating copy to clipboard operation
uvloop copied to clipboard

RuntimeError: Timeout context manager should be used inside a task

Open dark0ghost opened this issue 6 years ago • 10 comments

  • uvloop version:uvloop==0.13.0
  • Python version: 3.7.3
  • Platform: debian 10

dark0ghost avatar Oct 03 '19 19:10 dark0ghost

  • uvloop version:uvloop==0.13.0
  • Python version: 3.7.3
  • Platform: debian 10

traceback : https://pastebin.com/q2yvq236 handler: https://pastebin.com/RhdV38Zw class pastebin : https://gist.github.com/dark0ghost/216348a1ed14468933bf649c1427af21 was use uvloop and send traceback, if use asyncio loop , then no traceback

dark0ghost avatar Oct 03 '19 19:10 dark0ghost

@asvetlov Any ideas what might be going on here? I'm wondering why the behaviour of aiohttp.Timeout might be different on vanilla vs uvloop

1st1 avatar Oct 03 '19 21:10 1st1

The error is generated if asyncio.current_task() returns None. Normally, it should never happen if the call is performed from async function like in provided code snippets (await aiohttp_session.post(...))

asvetlov avatar Oct 24 '19 22:10 asvetlov

What need information?

dark0ghost avatar Oct 24 '19 22:10 dark0ghost

Instruction on how to reproduce the problem locally on my laptop would be awesome!

FYI, I'm able to run aiohttp test suite on uvloop without any problem except one test that heavily mocks asyncio transport details.

asvetlov avatar Oct 24 '19 22:10 asvetlov

Full code https://github.com/dark0ghost/async_py_bot, but need fill json , then bot started. Or unplug module

dark0ghost avatar Oct 24 '19 22:10 dark0ghost

It doesn't look like the easy reproducible example, sorry.

asvetlov avatar Oct 24 '19 22:10 asvetlov

@dark0ghost would really help if you could give us a single Python file that reproduces the bug along with clear instructions how to run it.

1st1 avatar Oct 25 '19 02:10 1st1

https://github.com/dark0ghost/async_py_bot/blob/master/handlers/message_handler.py#L201

dark0ghost avatar Oct 25 '19 04:10 dark0ghost

launched this https://gist.githubusercontent.com/dark0ghost/3c8d963a2c2690237eae26c0ebe7f9cb/raw/79a734cde999cd7e1138de39d15391ad232ac25f/Pastebin.py so this bug is not, because use full code, to get that bug

dark0ghost avatar Dec 02 '19 05:12 dark0ghost