Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-146096: Fix base exception group repr#146141

Merged
iritkatriel merged 5 commits intopython:mainfrom
sergey-miryanov:bug/146096-fix-base-exception-group-repr
Mar 19, 2026
Merged

GH-146096: Fix base exception group repr#146141
iritkatriel merged 5 commits intopython:mainfrom
sergey-miryanov:bug/146096-fix-base-exception-group-repr

Conversation

@sergey-miryanov
Copy link
Contributor

@sergey-miryanovsergey-miryanov commentedMar 18, 2026
edited by bedevere-appbot
Loading

Fix segfault when calling repr for BaseExceptionGroup.

cc@dr-carlos

dr-carlos reacted with thumbs up emoji
@dr-carlos
Copy link
Contributor

dr-carlos commentedMar 18, 2026
edited
Loading

Thanks for the fix@sergey-miryanov! All looks good to me.
My apologies for not considering thatargs was mutable in the first implementation!

It's a pity that we don't preserve the list-like repr (ExceptionGroup('msg', [ValueError()])) in this case. But mutating theargs to something without an exceptions list in it seems like a weird enough use case that we can just do this?
If this is something that people actually do (why?), we could just set theself->excs_str in all cases, but that can be quite inefficient and I'd really prefer not to.

sergey-miryanov reacted with thumbs up emoji

* with self.exceptions. Instead, use self.exceptions for accuracy,
* making it look like self.args[1] for backwards compatibility. */
if (PyList_Check(PyTuple_GET_ITEM(self->args, 1))) {
if (PyTuple_GET_SIZE(self->args) == 2 &&PyList_Check(PyTuple_GET_ITEM(self->args, 1))) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Do we need to check that it's a Tuple first?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Could add an assert just so it reads like it makes sense.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Done

iritkatriel reacted with thumbs up emoji
@sergey-miryanov
Copy link
ContributorAuthor

I'm not sure that failed test related to change.

@iritkatrieliritkatriel merged commitced6460 intopython:mainMar 19, 2026
50 checks passed
@sergey-miryanovsergey-miryanov deleted the bug/146096-fix-base-exception-group-repr branchMarch 19, 2026 11:26
@sergey-miryanov
Copy link
ContributorAuthor

Thanks all!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@iritkatrieliritkatrieliritkatriel approved these changes

@picnixzpicnixzAwaiting requested review from picnixz

+1 more reviewer

@dr-carlosdr-carlosdr-carlos left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@sergey-miryanov@dr-carlos@iritkatriel@kumaraditya303

[8]ページ先頭

©2009-2026 Movatter.jp