This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: contextlib.ExitStack introduces a cycle in exception __context__
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Hang with contextlib.ExitStack and subprocess.Popen (regression)
View: 27122
Assigned To: Nosy List: Yury.Selivanov, gvanrossum, iritkatriel, larry, martin.panter, ncoghlan, oconnor663, serhiy.storchaka, yselivanov
Priority: normal Keywords: patch

Created on 2015-12-02 19:58 by yselivanov, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Issue25786.patch yselivanov, 2015-12-02 19:59 review
Messages (6)
msg255762 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2015-12-02 19:58
See http://bugs.python.org/issue25779 and http://bugs.python.org/issue25782 for details.
msg255764 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2015-12-02 19:59
Nick, could you please take a look at the attached patch?
msg255798 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-12-03 00:46
If I understand this issue correctly, perhaps the test case should be augmented to check for a cycle:

try:
    main()
except RuntimeError as exc:
    self.assertIsNone(exc.__cause__)
else:
    self.fail("Expected RuntimeError")
msg255994 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2015-12-06 00:44
I don't agree that a reference cycle counts as a release blocker.
msg255999 - (view) Author: Yury Selivanov (Yury.Selivanov) * Date: 2015-12-06 02:20
This cycle leads to infinite unbreakable loop in cpython c internals.

Sent from my iPhone

> On Dec 5, 2015, at 7:44 PM, Larry Hastings <report@bugs.python.org> wrote:
> 
> 
> Larry Hastings added the comment:
> 
> I don't agree that a reference cycle counts as a release blocker.
> 
> ----------
> nosy: +larry
> priority: release blocker -> normal
> 
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue25786>
> _______________________________________
msg391592 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-04-22 12:12
Looks like it was fixed in contextlib here: 

https://github.com/python/cpython/commit/ba2ecd68414b9c53d00560579f5bc13459bc0449
History
Date User Action Args
2022-04-11 14:58:24adminsetgithub: 69972
2021-04-22 14:34:16iritkatrielsetstatus: pending -> closed
superseder: Hang with contextlib.ExitStack and subprocess.Popen (regression)
resolution: fixed -> duplicate
stage: resolved
2021-04-22 12:12:02iritkatrielsetstatus: open -> pending

nosy: + iritkatriel
messages: + msg391592

resolution: fixed
2015-12-06 02:20:14Yury.Selivanovsetnosy: + Yury.Selivanov
messages: + msg255999
2015-12-06 00:44:18larrysetpriority: release blocker -> normal
nosy: + larry
messages: + msg255994

2015-12-03 00:46:38martin.pantersetnosy: + martin.panter
messages: + msg255798
2015-12-02 20:06:12oconnor663setnosy: + oconnor663
2015-12-02 19:59:54yselivanovsetfiles: + Issue25786.patch
keywords: + patch
messages: + msg255764
2015-12-02 19:58:45yselivanovcreate