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 — C API: Remove legacy buffer API like PyObject_AsReadBuffer() · Issue #105186 · python/cpython

C API: Remove legacy buffer API like PyObject_AsReadBuffer() #105186

New issue
Copy link
New issue
Copy link
Closed
Closed
C API: Remove legacy buffer API like PyObject_AsReadBuffer()#105186
Copy link
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@vstinner
vstinner
opened on Jun 1, 2023
Issue body actions

Would it be ok to remove the legacy "buffer" API in Python 3.13, scheduled for October 2024? I'm talking about functions:

  • PyObject_AsCharBuffer()
  • PyObject_CheckReadBuffer()
  • PyObject_AsReadBuffer()
  • PyObject_AsWriteBuffer()

This API is deprecated since Python 3.0 and is older than the new Py_buffer API. The Py_buffer API is safer: it has a PyBuffer_Release() method to notify when the consumer is done: the resource can be released. The Py_buffer API is now commonly used.

In June 2020, there was a first attempt to remove these functions in issue #85275: commit 6f8a6ee. It caused too many troubles and had to be reverted the following year (commit ce5e1a6, July 2021). The removed functions were still used by at least 6 projects:

  • PyQt4: FIXED in PyQt5 by using the safe PyObject_GetBuffer()/PyBuffer_Release() functions. PyQt4 is now legacy.
  • libsolv: FIXED. it seems like it has been solved in libsolv fails with Python 3.10: _solv.so: undefined symbol: PyObject_AsReadBuffer openSUSE/libsolv#410
  • m2crypto: FIXED in m2crypto 0.37.1 by https://gitlab.com/m2crypto/m2crypto/-/commit/6bb65c27f01dd69f08c4654ce531fb283c7bcc07
  • apsw: FIXED in 3.35.4-r1, deprecated buffer protocol API rogerbinns/apsw#301
  • wsaccel: FIXED in v0.6.3: deprecated buffer protocol API methane/wsaccel#22 and methane/wsaccel@b171314
  • djvulibre: It seems like it stills uses PyObject_AsWriteBuffer(). But https://github.com/jwilk-archive/python-djvulibre project has been archived by the owner on Oct 4, 2022 and is now read-only!

The webassets project was also mentioned, but I'm not sure that its failure is related to these removal: see https://bugzilla.redhat.com/show_bug.cgi?id=1899555 I cannot find these functions in https://github.com/Kronuz/pyScss code right now.

Sadly, the 4 functions are part of the stable ABI and have to be kept there. I'm only asking to remove them in the C API. The issue #88775 was complaining that the functions were removed wheareas they are part of the stable ABI.

Activity

  1. vstinner
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Jun 1, 2023
  2. vstinner commented on Jun 1, 2023

    @vstinner
    vstinner
    on Jun 1, 2023
    MemberAuthor
    More actions

    @methane: Would do you think? If you think that it's now ok, I can work on a PR to remove them (but keep them in the stable ABI).

  3. methane commented on Jun 1, 2023

    @methane
    methane
    on Jun 1, 2023
    Member
    More actions

    See
    #105137

  4. vstinner commented on Jun 1, 2023

    @vstinner
    vstinner
    on Jun 1, 2023
    MemberAuthor
    More actions

    Oh nice, let's discussion the discussion in issue #85275 (and PR #105137).

  5. vstinner
    closed this as completedon Jun 1, 2023
  6. chris-allan
    added a commit that references this issue on Feb 26, 2025

    Add support for Python 3.13 (See zeroc-ice/ice#2906)

    0efd731
  7. chris-allan
    added 3 commits that reference this issue on Jun 25, 2026

    Add support for Python 3.13 (See zeroc-ice/ice#2906)

    113a093

    Add support for Python 3.13 (See zeroc-ice/ice#2906)

    f3f6c10

    Add support for Python 3.13 (See zeroc-ice/ice#2906)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      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.