Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Buffer support in the stable ABI #88775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tarunjohar mannequin opened this issue Jul 12, 2021 · 2 comments
Closed

Buffer support in the stable ABI #88775

tarunjohar mannequin opened this issue Jul 12, 2021 · 2 comments
Labels
3.10 only security fixes build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@tarunjohar
Copy link
Mannequin

tarunjohar mannequin commented Jul 12, 2021

BPO 44609
Nosy @encukou, @methane

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 = None
closed_at = <Date 2021-10-21.13:30:09.065>
created_at = <Date 2021-07-12.15:05:02.827>
labels = ['type-bug', '3.10', 'build']
title = 'Buffer support in the stable ABI'
updated_at = <Date 2021-10-21.13:30:09.061>
user = 'https://bugs.python.org/tarunjohar'

bugs.python.org fields:

activity = <Date 2021-10-21.13:30:09.061>
actor = 'petr.viktorin'
assignee = 'none'
closed = True
closed_date = <Date 2021-10-21.13:30:09.065>
closer = 'petr.viktorin'
components = ['Build']
creation = <Date 2021-07-12.15:05:02.827>
creator = 'tarun.johar'
dependencies = []
files = []
hgrepos = []
issue_num = 44609
keywords = []
message_count = 2.0
messages = ['397319', '404601']
nosy_count = 3.0
nosy_names = ['petr.viktorin', 'methane', 'tarun.johar']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue44609'
versions = ['Python 3.10']

@tarunjohar
Copy link
Mannequin Author

tarunjohar mannequin commented Jul 12, 2021

PEP-384 and PEP-652 define a stable ABI to be used with Python 3.2 and later. On Windows, symbols for the stable ABI are exported from the python3.dll shared library.

The following functions are present in Python 3.9 but have been removed from Python 3.10b3:

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

The justification for the removal of these functions was discussed in this issue:

https://bugs.python.org/issue41103

Without these functions, an extension cannot utilize the stable ABI to access the buffer memory of data structures. The buffer protocol is suggested as an alternative, but the buffer functions PyObject_GetBuffer() and PyBuffer_Release() are not present in the stable ABI.

While these two functions may be added to the stable ABI, removal of the four functions above makes Python 3.10 incompatible with previous versions. It is requested that the four functions be reinstated and maintained as described in PEP-652.

@tarunjohar tarunjohar mannequin added 3.10 only security fixes build The build process and cross-build type-bug An unexpected behavior, bug, or error labels Jul 12, 2021
@encukou
Copy link
Member

encukou commented Oct 21, 2021

That removal was reverted. Thanks for the report!

They are still deprecated, which means they may be removed from future API (and only remain in the stable ABI).
But I hope that's only considered when the new buffer protocol is available in the stable ABI.

@encukou encukou closed this as completed Oct 21, 2021
@encukou encukou closed this as completed Oct 21, 2021
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.10 only security fixes build The build process and cross-build type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant