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

SuspectedPyErr_Fetch() behavior change #102594

Closed
Labels
3.12only security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error
@rwgk

Description

@rwgk

Bug report

While testing pybind11 with Python 3.12alpha6 I ran into what looks like aPyErr_Fetch() behavior change. I also tried with the main branch @c6858d1.

I think the issue reduces to:

The special twist is that the exception type involved raises aValueError in its__init__:

For easy reference the same code copy-pasted here:

class FlakyException(Exception):    def __init__(self, failure_point):        if failure_point == "failure_point_init":            raise ValueError("triggered_failure_point_init")        self.failure_point = failure_point
  • Up to and including 3.12alpha3:PyErr_Fetch() produces theFlakyException type (this here).

  • With 3.12alpha6:PyErr_Fetch() produces theValueError type instead.

Additional detail:

Up to and including 3.12alpha3: onlyPyErr_NormalizeException() hits theValueError inFlakyException._init__, but notPyErr_Fetch().

Your environment

  • CPython versions tested on: 3.12alpha6, main branch @c6858d1
  • Operating system and architecture: Debian 5.19.11 clang14, ubuntu22 gcc11

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp