[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-24 Thread Yury Selivanov
Yury Selivanov added the comment: This can probably be closed now. Thanks Victor and Nathaniel! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker _

[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-24 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset 789e359f51d2b27bea01b8c6c3bf090aaedf8839 by Yury Selivanov (Victor Stinner) in branch 'master': bpo-32636: Fix two bugs in test_asyncio (#5302) https://github.com/python/cpython/commit/789e359f51d2b27bea01b8c6c3bf090aaedf8839 -- __

[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-24 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset fb5a7ad421ac20c49218ee4b86fb0d85ca4cd664 by Yury Selivanov (Nathaniel J. Smith) in branch 'master': bpo-32636: Fix @asyncio.coroutine debug mode bug exposed by gh-5250 (#5291) https://github.com/python/cpython/commit/fb5a7ad421ac20c49218ee4b86fb0

[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-24 Thread STINNER Victor
STINNER Victor added the comment: > Victor, can you submit a new PR for this? Let's merge this right away. Ok, done: https://github.com/python/cpython/pull/5302 -- ___ Python tracker

[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-24 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +5149 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-24 Thread Yury Selivanov
Yury Selivanov added the comment: > Nathaniel: do you want to include these fixes in your PR as well? Victor, can you submit a new PR for this? Let's merge this right away. -- ___ Python tracker

[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-24 Thread STINNER Victor
STINNER Victor added the comment: > I plan to always run the Python test suite (especially when running on our > CIs) in the new Python 3.7 "development mode" (python3 -X dev) which enables > asyncio debug mode. Are you ok with that? Oh, I forgot to mention the obvious drawback: asyncio debug

[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-24 Thread STINNER Victor
STINNER Victor added the comment: Fix for the two remaining bugs: diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py index 8d72df6a72..6489f50f27 100644 --- a/Lib/test/test_asyncio/test_base_events.py +++ b/Lib/test/test_asyncio/test_base_events.

[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-24 Thread STINNER Victor
STINNER Victor added the comment: Good. Using PR 5291, test_asyncio doesn't hang anymore, and only 2 tests still fail: == ERROR: test_foobar (test.test_asyncio.test_tasks.CTask_Future_Tests) ---

[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-23 Thread Nathaniel Smith
Change by Nathaniel Smith : -- keywords: +patch pull_requests: +5137 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-l

[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-23 Thread Nathaniel Smith
Nathaniel Smith added the comment: Ah-hah, I get what's going on. @asyncio.coroutine has always been buggy: when debug mode is turned on, then it fails to set CO_ITERABLE_COROUTINE. However, when debug mode is turned on, then traditionally native coroutines got wrapped into CoroWrapper objec

[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-23 Thread Yury Selivanov
Yury Selivanov added the comment: No, it's this specific commit. I can double check later, but I'm pretty sure about that. -- ___ Python tracker ___ _

[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-23 Thread Nathaniel Smith
Nathaniel Smith added the comment: How confident are we that this is a regression from the coroutine origin tracking changes? (I'd double-check myself, but my cpython checkout is tied up for the next few hours doing --enable-optimizations builds.) Looking at @asyncio.coroutine, in particular

[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-23 Thread Yury Selivanov
Yury Selivanov added the comment: asyncio.coroutine sets the co_flags bit CO_ITERABLE_COROUTINE for generator functions' code objects. With that bit flag, Python allows to 'yield from' native coroutines. CoroWrapper.send() -> wrapped_generator.send() -> YIELD_FROM(native_coro) -> native_coro

[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-23 Thread Nathaniel Smith
Nathaniel Smith added the comment: (However, I can report that at least that particular test starts working again if I convert 'sleeper' into an 'async def' coroutine.) -- ___ Python tracker

[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-23 Thread Nathaniel Smith
Nathaniel Smith added the comment: Question: there are lots of tests -- for example test.test_asyncio.test_tasks.CTaskSubclass_PyFuture_Tests.test_wait_with_exception, which freezes for me -- that use 'yield from asyncio.sleep(...)', e.g.: @asyncio.coroutine def sleeper():

[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-23 Thread Nathaniel Smith
Nathaniel Smith added the comment: Huh, weird. I'll take a look. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-23 Thread Yury Selivanov
Yury Selivanov added the comment: Nathaniel, this is is a regression of fc2f407829d9817ddacccae6944dd0879cfaca24 -- bpo-32591: Add native coroutine origin tracking. Please take a look. -- nosy: +njs ___ Python tracker

[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-23 Thread STINNER Victor
STINNER Victor added the comment: I used this change to skip the test which hangs, (1): diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py index 1c361c8ec1..cf01df7061 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py

[issue32636] test_asyncio fails with PYTHONASYNCIODEBUG=1

2018-01-23 Thread STINNER Victor
New submission from STINNER Victor : (1) test.test_asyncio.test_tasks.CTaskSubclass_PyFuture_Tests.test_wait_with_exception() hangs: vstinner@apu$ PYTHONASYNCIODEBUG=1 ./python -m test test_asyncio -m test_wait_with_exception -v == CPython 3.7.0a4+ (heads/freebsd_configure:27218edef7, Jan 23