Uvloop: AttributeError: module 'asyncio.coroutines' has no attribute 'debug_wrapper'

Created on 4 Mar 2018  路  8Comments  路  Source: MagicStack/uvloop

  • uvloop version: v0.9.1
  • Python version: 3.7b1
  • Platform: Alpine 3.7
  • Can you reproduce the bug with PYTHONASYNCIODEBUG in env?: Not relevant

AttributeError: module 'asyncio.coroutines' has no attribute 'debug_wrapper'

asyncio no longer uses sys.set_coroutine_wrapper. So asynicio.coroutines no longer has a debug_wrapper
https://github.com/python/cpython/pull/5250

Most helpful comment

I'll work on this next week. Expect to see an update soon.

All 8 comments

I am seeing this on python 3.7.0b4 with uvloop 0.9.1

I installed from git -- it says it is uvloop-0.9.2.dev0 -- and I see the same error.

3.7 is getting close to release! People cannot easily test if fundamental libs like uvloop and pyyaml are not updated.

Looks like PR https://github.com/MagicStack/uvloop/pull/138 is intended to fix this bug -- I installed the branch from the PR and this test passes for me.

I'll work on this next week. Expect to see an update soon.

Can confirm this also.

If it is any use, this is the traceback I get for this.

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/ashley/code/n3/n3/__main__.py", line 57, in <module>
    main()
  File "/home/ashley/code/n3/n3/__main__.py", line 47, in main
    import uvloop
  File "/home/ashley/code/n3/venv/lib/python3.7/site-packages/uvloop/__init__.py", line 7, in <module>
    from .loop import Loop as __BaseLoop  # NOQA
  File "uvloop/includes/stdlib.pxi", line 41, in init uvloop.loop
AttributeError: module 'asyncio.coroutines' has no attribute 'debug_wrapper'

Platform: Python3.7b4, Ubuntu 16.04.3 LTS x64

Fixed in #149. You can now build uvloop from source and test under Python 3.7.

@1st1 Is there a similar error with Python 3.8?

I've tried installing datasette, uvicorn, and uvloop all from master HEAD. Get the following error:

  File "/Users/willingc/projects/datasette-bpo/uvicorn/uvicorn/loops/auto.py", line 6, in auto_loop_setup
    import uvloop
  File "/Users/willingc/projects/datasette-bpo/testenv/lib/python3.8/site-packages/uvloop/__init__.py", line 7, in <module>
    from .loop import Loop as __BaseLoop  # NOQA
  File "uvloop/includes/stdlib.pxi", line 41, in init uvloop.loop
AttributeError: module 'asyncio.coroutines' has no attribute 'debug_wrapper'

I've tried installing datasette, uvicorn, and uvloop all from master HEAD. Get the following error:

That's weird, as that line of code was fixed a year ago:

https://github.com/MagicStack/uvloop/blob/695a520195c7cecc20754cf41e98b4242dc26fcc/uvloop/includes/stdlib.pxi#L46

I suspect you're using an old version of uvloop. Try installing with pip install uvloop==0.14.0rc1.

Thanks @1st1 that resolved the issue. :smile:

@willingc Note that 0.14.0rc1 had a nasty bug with libuv ignoring SIGINT. Install 0.14.0rc2 with pip install uvloop==0.14.0rc2

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iceboy233 picture iceboy233  路  8Comments

amackillop picture amackillop  路  4Comments

urbaniak picture urbaniak  路  5Comments

autumnjolitz picture autumnjolitz  路  6Comments

GoodPete picture GoodPete  路  8Comments