Skip to content

PyObject_AsWriteBuffer is removed from CPython in 3.10 #190

@tacaswell

Description

@tacaswell

See https://github.com/python/cpython/blob/e4f1fe6edb216e04da03ae80b462ca273f00255b/Doc/whatsnew/3.10.rst#removed-1

It looks like PyObject_AsWriteBuffer is currently a wrapper around the new API (https://docs.python.org/3/c-api/objbuffer.html?highlight=pyobject_aswritebuffer#c.PyObject_AsWriteBuffer).

It looks like pycairo uses this function in one place (and wraps it to suppress the deprecation warnings)

pycairo/cairo/surface.c

Lines 823 to 825 in f0c0e5a

PYCAIRO_BEGIN_IGNORE_DEPRECATED
res = PyObject_AsWriteBuffer (obj, (void **)&buffer, &buffer_len);
PYCAIRO_END_IGNORE_DEPRECATED

Unfortunately I do not have time right now to dig into this and offer a fix.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions