Skip to content

PyErr_ExceptionMatches must not fail #46794

Closed

Description

@theller
BPO 2542
Nosy @gvanrossum, @warsaw, @theller, @amauryfa, @devdanzin, @benjaminp
Files
  • errors.diff
  • test_exceptions.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/amauryfa'
    closed_at = <Date 2008-07-31.01:47:25.644>
    created_at = <Date 2008-04-03.08:58:59.380>
    labels = ['interpreter-core', 'type-crash', 'release-blocker']
    title = 'PyErr_ExceptionMatches must not fail'
    updated_at = <Date 2008-07-31.01:47:25.609>
    user = 'https://github.com/theller'

    bugs.python.org fields:

    activity = <Date 2008-07-31.01:47:25.609>
    actor = 'benjamin.peterson'
    assignee = 'amaury.forgeotdarc'
    closed = True
    closed_date = <Date 2008-07-31.01:47:25.644>
    closer = 'benjamin.peterson'
    components = ['Interpreter Core']
    creation = <Date 2008-04-03.08:58:59.380>
    creator = 'theller'
    dependencies = []
    files = ['9931', '9932']
    hgrepos = []
    issue_num = 2542
    keywords = ['patch']
    message_count = 9.0
    messages = ['64894', '64899', '64921', '68003', '69486', '70418', '70420', '70450', '70452']
    nosy_count = 6.0
    nosy_names = ['gvanrossum', 'barry', 'theller', 'amaury.forgeotdarc', 'ajaksu2', 'benjamin.peterson']
    pr_nums = []
    priority = 'release blocker'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue2542'
    versions = ['Python 2.6']

    Activity

    1. theller commented on Apr 3, 2008

      @theller
      Author

      PyErr_ExceptionMatches must not fail, according to the docs. So an
      error code from PyObject_IsSubclass() cannot be returned.

      The attached patch calls PyErr_WriteUnraisable in this case, and returns
      an arbitrary value (0 was chosen in the patch).

      See also issue bpo-2534.

    2. added
      interpreter-core(Objects, Python, Grammar, and Parser dirs)
      type-crashA hard crash of the interpreter, possibly with a core dump
      on Apr 3, 2008
    3. devdanzin commented on Apr 3, 2008

      devdanzinmannequin
      Mannequin

      The tests pass and prints the ignores. But I still see an issue:

      import sys
      def g():
          try:
              return g()
          except:
              return sys.exc_info()
      >>> g()
      (<type 'exceptions.RuntimeError'>, 'maximum recursion depth exceeded
      while calling a Python object', <traceback object at 0xb7d3d75c>)
      >>> import sys
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      RuntimeError: maximum recursion depth exceeded

      Then, I can raise that RuntimeError and clear things:

      >>> sys.excepthook(*g())
      Traceback (most recent call last):
        File "<stdin>", line 3, in g
      RuntimeError: maximum recursion depth exceeded while calling a Python object
      >>> import sys
      >>> 

      The attached patch adds a test for this condition, I hope someone more
      test-savvy than I can review it.

    4. theller commented on Apr 4, 2008

      @theller
      Author

      Daniel, IMO you've found a separate bug. I added it as issue bpo-2548.

    5. warsaw commented on Jun 11, 2008

      @warsaw
      Member

      This is a bug, not a new feature so it's not release critical for the
      first alphas.

    6. gvanrossum commented on Jul 9, 2008

      @gvanrossum
      Member

      FWIW some comments by Amaury are here:
      http://codereview.appspot.com/483

    7. gvanrossum commented on Jul 30, 2008

      @gvanrossum
      Member

      Ping? Anyone cares about this?

    8. amauryfa commented on Jul 30, 2008

      @amauryfa
      Contributor

      I am working on Thomas' patch, plus tests.

    9. self-assigned this
      on Jul 30, 2008
    10. amauryfa commented on Jul 31, 2008

      @amauryfa
      Contributor

      Committed r65320 in trunk.
      I'll close the issue after it is merged into py3k.

    11. benjaminp commented on Jul 31, 2008

      @benjaminp
      Contributor

      I just merged it.

    12. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)release-blockertype-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions