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: ExceptionGroup.split()/subgroup() don't copy __note__ to parts
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: iritkatriel Nosy List: iritkatriel
Priority: normal Keywords: patch

Created on 2021-12-16 22:36 by iritkatriel, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 30159 merged iritkatriel, 2021-12-16 23:18
Messages (3)
msg408740 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-12-16 22:36
>>> e = ExceptionGroup("eg", [ValueError(1), TypeError(2)])
>>> e.__note__ = "a note"
>>> e.split(ValueError)
(ExceptionGroup('eg', [ValueError(1)]), ExceptionGroup('eg', [TypeError(2)]))
>>> e.split(ValueError)[0].__note__
>>> e.subgroup(ValueError).__note__
msg408742 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-12-16 23:32
With the patch:

>>> e = ExceptionGroup("eg", [ValueError(1), TypeError(2)])
>>> e.__note__ = "a note"
>>> e.split(ValueError)
(ExceptionGroup('eg', [ValueError(1)]), ExceptionGroup('eg', [TypeError(2)]))
>>> e.split(ValueError)[0].__note__
'a note'
>>> e.split(ValueError)[1].__note__
'a note'
>>> e.subgroup(ValueError).__note__
'a note'
>>>
msg408997 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-12-21 10:12
New changeset c66fc0fb53b5316dc325fde3bc738890515d38a4 by Irit Katriel in branch 'main':
bpo-46107: ExceptionGroup.subgroup()/split() should copy __note__ to the parts (GH-30159)
https://github.com/python/cpython/commit/c66fc0fb53b5316dc325fde3bc738890515d38a4
History
Date User Action Args
2022-04-11 14:59:53adminsetgithub: 90265
2021-12-21 10:17:55iritkatrielsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-12-21 10:12:34iritkatrielsetmessages: + msg408997
2021-12-16 23:35:10iritkatrielsettype: behavior
2021-12-16 23:32:49iritkatrielsetmessages: + msg408742
2021-12-16 23:18:21iritkatrielsetkeywords: + patch
stage: patch review
pull_requests: + pull_request28378
2021-12-16 22:38:18iritkatrielsetassignee: iritkatriel
2021-12-16 22:36:49iritkatrielcreate