GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — PEP 688: Crash if `__release_buffer__` is called while an exception is active · Issue #104371 · python/cpython

PEP 688: Crash if __release_buffer__ is called while an exception is active #104371

New issue
Copy link
New issue
Copy link
Closed
Closed
PEP 688: Crash if __release_buffer__ is called while an exception is active#104371
Copy link
Assignees
JelleZijlstra
Labels
release-blockertype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@JelleZijlstra
JelleZijlstra
opened on May 10, 2023
Issue body actions
class A:
    def __buffer__(self, flags):
            return memoryview(bytes(8))
    def __release_buffer__(self, view):
            pass # do not need to do anything here, just needs to exist

b = bytearray(8)
m = memoryview(b) # now b.extend will raise an exception due to exports
b.extend(A())

In a debug build this crashes with Assertion failed: (!PyErr_Occurred()), function _PyType_Lookup, file typeobject.c, line 4707.

Reported by @chilaxan. I'll work on a fix later today.

Most likely, the fix will be to call PyErr_Fetch/PyErr_Restore around calls to Python __release_buffer__ methods.

Linked PRs

  • gh-104371: Fix calls to __release_buffer__ while an exception is active #104378
  • GH-104371: check return value of calling mv.release #104417

Activity

  1. JelleZijlstra
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    release-blocker
    on May 10, 2023
  2. ezio-melotti
    added this to Release and Deferred blockers 🚫on May 10, 2023
  3. github-project-automation
    moved this to Todo in Release and Deferred blockers 🚫on May 10, 2023
  4. JelleZijlstra
    self-assigned this
    on May 10, 2023
  5. JelleZijlstra
    added a commit that references this issue on May 11, 2023

    pythongh-104371: Fix calls to __release_buffer__ while an exception i…

    9abea7e
  6. kumaraditya303
    added a commit that references this issue on May 12, 2023

    gh-104371: Fix calls to `__release_buffer__` while an exception is ac…

    a0a98dd
  7. kumaraditya303
    closed this as completedon May 12, 2023
  8. github-project-automation
    moved this from Todo to Done in Release and Deferred blockers 🚫on May 12, 2023
  9. kumaraditya303
    added a commit that references this issue on May 12, 2023

    GH-104371: check return value of calling `mv.release` (#104417)

    a052be4
  10. carljm
    added a commit that references this issue on May 12, 2023

    Merge branch 'main' into supermon

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

Metadata

Metadata

Assignees

  • @JelleZijlstra
    JelleZijlstra

Labels

release-blockertype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Projects

  • Release and Deferred blockers 🚫
    Status
    Done
    Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.