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.

Author iritkatriel
Recipients Dennis Sweeney, Rotem Yaari, Yury.Selivanov, chris.jerdonek, georg.brandl, iritkatriel, larry, larsonreever, ncoghlan, oconnor663, python-dev, serhiy.storchaka, terry.reedy, yselivanov
Date 2021-04-22.22:20:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619130029.58.0.399982884174.issue25782@roundup.psfhosted.org>
In-reply-to
Content
I agree with Chris that the issue of not hanging is independent of the question what to do about the cycle.  The ExitStack issue that brought this issue about is now fixed in ExitStack (see issue25786, issue27122).

If we take a step back from that, the situation is this: SetObject's cycle detection loop is intended to prevent the creation of new cycles when adding a new context link. It hangs when the exception chain has a pre-existing cycle.  That pre-existing cycle is arguably a bug, and I'm not sure it's SetObject's job to do anything about it.

So I would suggest to:
(1) Make it not hang, ASAP because this is a bug in SetObject.
(2) Leave the cycle alone.
History
Date User Action Args
2021-04-22 22:20:29iritkatrielsetrecipients: + iritkatriel, georg.brandl, terry.reedy, ncoghlan, larry, chris.jerdonek, Yury.Selivanov, python-dev, serhiy.storchaka, yselivanov, oconnor663, Rotem Yaari, larsonreever, Dennis Sweeney
2021-04-22 22:20:29iritkatrielsetmessageid: <1619130029.58.0.399982884174.issue25782@roundup.psfhosted.org>
2021-04-22 22:20:29iritkatriellinkissue25782 messages
2021-04-22 22:20:29iritkatrielcreate