[issue24342] coroutine wrapper reentrancy

2015-06-02 Thread Yury Selivanov

Changes by Yury Selivanov yseliva...@gmail.com:


--
resolution:  - fixed
stage: patch review - resolved
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24342
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24342] coroutine wrapper reentrancy

2015-06-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 19d613c2cd5f by Yury Selivanov in branch '3.5':
Issue 24342: Let wrapper set by sys.set_coroutine_wrapper fail gracefully
https://hg.python.org/cpython/rev/19d613c2cd5f

New changeset 8a6db1679a23 by Yury Selivanov in branch 'default':
Issue 24342: Let wrapper set by sys.set_coroutine_wrapper fail gracefully
https://hg.python.org/cpython/rev/8a6db1679a23

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24342
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24342] coroutine wrapper reentrancy

2015-06-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d11cb1218489 by Yury Selivanov in branch '3.5':
Issue 24342: No need to use PyAPI_FUNC for _PyEval_ApplyCoroutineWrapper
https://hg.python.org/cpython/rev/d11cb1218489

New changeset b83fbc13ae1e by Yury Selivanov in branch 'default':
Issue 24342: No need to use PyAPI_FUNC for _PyEval_ApplyCoroutineWrapper
https://hg.python.org/cpython/rev/b83fbc13ae1e

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24342
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24342] coroutine wrapper reentrancy

2015-06-01 Thread Yury Selivanov

Yury Selivanov added the comment:

  why wouldn't it be good enough in this case?

Because it's highly non-obvious, it took me a while to understand what's 
*actually* going on.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24342
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24342] coroutine wrapper reentrancy

2015-06-01 Thread Skip Montanaro

Skip Montanaro added the comment:

This is a bit off topic, but why did my reply to Yuri's ticket by email change 
the title? I didn't mess with the subject in my mail.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24342
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24342] coroutine wrapper reentrancy

2015-06-01 Thread Eric Snow

Eric Snow added the comment:

@Skip, because roundup will change the title to the subject of the email and 
the title had been changed after the message to which you replied.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24342
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24342] coroutine wrapper reentrancy

2015-06-01 Thread Eric Snow

Eric Snow added the comment:

Changing the title back. :)

--
nosy: +eric.snow
title: coroutine wrapper recursion - coroutine wrapper reentrancy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24342
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24342] coroutine wrapper reentrancy

2015-06-01 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24342
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24342] coroutine wrapper reentrancy

2015-06-01 Thread Nick Coghlan

Nick Coghlan added the comment:

Making sure I'm following the issue correctly here:

1. wrapper is a normal function, so there's no change for 
set_couroutine_wrapper() to detect anything might be amiss

2. any async def statement will call the registered coroutine wrapper to wrap 
the created function and turn it into a coroutine

3. this means any coroutine wrapper that directly or indirectly includes an 
async def statement will fail with RecursionError, without the problem being 
at all obvious

4. Yury's proposed patch effectively detects the use of async def inside a 
coroutine wrapper definition

I like the idea in principle, I don't like the error message in the current 
patch (since it only makes sense if you already understand the chain of 
reasoning above).

While it's a little verbose, I suggest an error like: Coroutine wrapper %r 
attempted to recursively wrap %r, passing in the currently registered 
coroutine wrapper, and the code object we're attempting to wrap, respectively.

The latter repr gives the name, filename and line number of the offending code 
object, while the former should give the qualname of the registered wrapper.

The docs for set_coroutine_wrapper() should also be tweaked to note the 
constraint that the wrapper function cannot itself define new asynchronous 
functions (neither directly nor indirectly).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24342
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24342] coroutine wrapper reentrancy

2015-06-01 Thread Yury Selivanov

Yury Selivanov added the comment:

Thanks, Nick!  I'll commit the patch with your error message (it's much better!)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24342
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24342] coroutine wrapper reentrancy

2015-05-31 Thread Yury Selivanov

Changes by Yury Selivanov yseliva...@gmail.com:


--
stage:  - patch review
title: coroutine wrapper recursion - coroutine wrapper reentrancy
type:  - behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24342
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com