classification
Title: Make sure exceptions raised in __aiter__ are properly chained in ceval
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.7, Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: yselivanov Nosy List: brett.cannon, ned.deily, serhiy.storchaka, vstinner, yselivanov
Priority: normal Keywords: patch

Created on 2016-12-07 04:41 by yselivanov, last changed 2017-03-31 16:36 by dstufft. This issue is now closed.

Files
File name Uploaded Description Edit
chain.patch yselivanov, 2016-12-07 04:41 review
Pull Requests
URL Status Linked Edit
PR 407 merged yselivanov, 2017-03-02 23:07
PR 414 merged yselivanov, 2017-03-03 03:29
PR 703 larry, 2017-03-17 21:00
PR 552 closed dstufft, 2017-03-31 16:36
Messages (6)
msg282595 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2016-12-07 04:41
Originally reported in http://bugs.python.org/issue28885#msg282538

Ned, please take a look at the attached patch.  While I think that the change is quite small & safe to merge, I think it's OK if we push this only in 3.6.1.  It's a nice usability improvement, but only for people that implement objects with custom __await__, which is quite a rare case.
msg282597 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-12-07 05:44
Should the original exception be stored on the __context__ or the __cause__ attribute? In the latter case you should use _PyErr_FormatFromCause().
msg282659 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2016-12-07 20:06
Yury, sounds like a bug to me so it would be appropriate for a maintenance release.  And not a showstopper release critical.
msg282675 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2016-12-07 22:56
Ned, sounds good.

Serhiy, we don't have _PyErr_FormatFromCause in 3.5, so I'll probably commit the patch as is in 3.5.  For 3.6 is definitely makes sense to use _PyErr_FormatFromCause.
msg288853 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2017-03-03 04:16
New changeset dea5101ae101aefed14de98e6bb1658f4cae8712 by Yury Selivanov in branch '3.6':
bpo-28893: Set __cause__ for errors in async iteration protocol (#407)
https://github.com/python/cpython/commit/dea5101ae101aefed14de98e6bb1658f4cae8712
msg290339 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2017-03-24 23:12
New changeset 398ff91ac0b8f4d930cd5d9e3e6a4bf247f810ef by Yury Selivanov in branch 'master':
bpo-28893: Set __cause__ for errors in async iteration protocol (#407)
https://github.com/python/cpython/commit/398ff91ac0b8f4d930cd5d9e3e6a4bf247f810ef
History
Date User Action Args
2017-03-31 16:36:30dstufftsetpull_requests: + pull_request1030
2017-03-24 23:12:08yselivanovsetmessages: + msg290339
2017-03-17 21:00:36larrysetpull_requests: + pull_request624
2017-03-03 23:10:38yselivanovsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-03-03 04:16:06yselivanovsetmessages: + msg288853
2017-03-03 03:29:03yselivanovsetpull_requests: + pull_request345
2017-03-02 23:07:50yselivanovsetpull_requests: + pull_request339
2016-12-07 22:56:43yselivanovsetmessages: + msg282675
2016-12-07 20:06:02ned.deilysetmessages: + msg282659
2016-12-07 09:32:05serhiy.storchakalinkissue28885 dependencies
2016-12-07 05:44:46serhiy.storchakasetmessages: + msg282597
2016-12-07 04:41:33yselivanovcreate