Skip to content
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

Some API methods could take const Py_buffer* instead of Py_buffer * #90298

Closed
DavidHewitt mannequin opened this issue Dec 20, 2021 · 3 comments
Closed

Some API methods could take const Py_buffer* instead of Py_buffer * #90298

DavidHewitt mannequin opened this issue Dec 20, 2021 · 3 comments
Labels
3.11 only security fixes

Comments

@DavidHewitt
Copy link
Mannequin

DavidHewitt mannequin commented Dec 20, 2021

BPO 46140
Nosy @serhiy-storchaka, @davidhewitt
PRs
  • bpo-46140: take more Py_buffer arguments as const * #30217
  • 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-12-22.13:08:49.715>
    created_at = <Date 2021-12-20.22:26:56.650>
    labels = ['3.11']
    title = 'Some API methods could take const Py_buffer* instead of Py_buffer *'
    updated_at = <Date 2021-12-22.13:08:49.714>
    user = 'https://github.com/davidhewitt'

    bugs.python.org fields:

    activity = <Date 2021-12-22.13:08:49.714>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-12-22.13:08:49.715>
    closer = 'serhiy.storchaka'
    components = []
    creation = <Date 2021-12-20.22:26:56.650>
    creator = 'davidhewitt'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46140
    keywords = ['patch']
    message_count = 3.0
    messages = ['408976', '409032', '409033']
    nosy_count = 2.0
    nosy_names = ['serhiy.storchaka', 'davidhewitt']
    pr_nums = ['30217']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue46140'
    versions = ['Python 3.11']

    @DavidHewitt
    Copy link
    Mannequin Author

    DavidHewitt mannequin commented Dec 20, 2021

    The limited api methods PyBuffer_GetPointer, PyBuffer_FromContiguous, PyBuffer_ToContiguous and PyMemoryView_FromBuffer take buffer arguments as Py_buffer *.

    They do not mutate the buffer info, so could simply take const Py_buffer *.

    There is already precedent to take const Py_buffer * argument in PyBuffer_IsContiguous.

    I'm going to submit a PR to fix.

    @DavidHewitt DavidHewitt mannequin added the 3.11 only security fixes label Dec 20, 2021
    @serhiy-storchaka
    Copy link
    Member

    New changeset 31ff967 by David Hewitt in branch 'main':
    bpo-46140: take more Py_buffer arguments as const * (GH-30217)
    31ff967

    @serhiy-storchaka
    Copy link
    Member

    Thank you for your contribution David.

    @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.11 only security fixes
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant