Skip to content

Using a frozen attributes to Exception class #134451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
RenameMe1 opened this issue May 21, 2025 · 2 comments
Closed

Using a frozen attributes to Exception class #134451

RenameMe1 opened this issue May 21, 2025 · 2 comments
Assignees
Labels
topic-asyncio topic-dataclasses type-bug An unexpected behavior, bug, or error

Comments

@RenameMe1
Copy link
Contributor

RenameMe1 commented May 21, 2025

Bug report

Bug description:

CycleFoundException in asyncio has frozen attributes, which has a problem related #99856

@dataclass(frozen=True)
class CycleFoundException(Exception):
"""Raised when there is a cycle when drawing the call tree."""
cycles: list[list[int]]
id2name: dict[int, str]

Do I need to fix this without using @DataClass?

CPython versions tested on:

3.11

Operating systems tested on:

No response

Linked PRs

@RenameMe1 RenameMe1 added the type-bug An unexpected behavior, bug, or error label May 21, 2025
@RenameMe1
Copy link
Contributor Author

@sobolevn can you see, please?

@sobolevn
Copy link
Member

I think that we can simplify this, yes. There are known problems with frozen dataclasses on exceptions. PR is welcome.

kumaraditya303 pushed a commit that referenced this issue May 23, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 23, 2025
…ataclass to a regular exception type. (pythonGH-134513)

(cherry picked from commit f9324cb)

Co-authored-by: Evgeny Demchenko <[email protected]>
@github-project-automation github-project-automation bot moved this from Todo to Done in asyncio May 23, 2025
kumaraditya303 pushed a commit that referenced this issue May 23, 2025
…dataclass to a regular exception type. (GH-134513) (#134564)

gh-134451: Converted `asyncio.tools.CycleFoundException` from dataclass to a regular exception type. (GH-134513)
(cherry picked from commit f9324cb)

Co-authored-by: Evgeny Demchenko <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-asyncio topic-dataclasses type-bug An unexpected behavior, bug, or error
Projects
Status: Done
Development

No branches or pull requests

4 participants