Skip to content

Regression in MemoryError displaying (_PyErr_Display fallback to C impl of print_exception) #110912

Closed

Description

@chgnrdv

Bug report

Bug description:

After e733136:

>>> raise MemoryError()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
object address  : 0x7fd3b6037540
object refcount : 3
object type     : 0x556d6e04cf40
object type name: MemoryError
object repr     : MemoryError()
lost sys.stderr

cc @pablogsal

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Activity

  1. self-assigned this
    on Oct 16, 2023
  2. serhiy-storchaka commented on Oct 16, 2023

    @serhiy-storchaka
    Member

    Seen this with real MemoryError, but I thought it was because the error handler couldn't run when out of memory. But if it produces this for an artificial MemoryError, something is very wrong.

  3. added a commit that references this issue on Oct 16, 2023
  4. pablogsal commented on Oct 16, 2023

    @pablogsal
    Member

    Seen this with real MemoryError, but I thought it was because the error handler couldn't run when out of memory. But if it produces this for an artificial MemoryError, something is very wrong.

    This was caused by an (incorrect) forceful fallback to the C implementation of the traceback machinery after we switched to use the Python traceback module as the main mechanism. Fixed in #110921

  5. added a commit that references this issue on Oct 16, 2023
  6. added a commit that references this issue on Feb 11, 2024
  7. added a commit that references this issue on Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

type-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions