Skip to content

Refactor ossaudiodev: use _Py_read and _Py_write with the Py_buffer #67897

Closed

Description

@vstinner
BPO 23709
Nosy @pitrou, @vstinner
Dependencies
  • bpo-23708: PEP 475: Add _Py_read() and _Py_write() functions
  • Files
  • ossaudiodev.patch
  • ossaudiodev-py_buffer.patch
  • 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 2015-03-20.09:40:21.099>
    created_at = <Date 2015-03-19.13:36:49.351>
    labels = []
    title = 'Refactor ossaudiodev: use _Py_read and _Py_write with the Py_buffer'
    updated_at = <Date 2015-03-20.09:40:21.099>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2015-03-20.09:40:21.099>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-03-20.09:40:21.099>
    closer = 'vstinner'
    components = []
    creation = <Date 2015-03-19.13:36:49.351>
    creator = 'vstinner'
    dependencies = ['23708']
    files = ['38559', '38571']
    hgrepos = []
    issue_num = 23709
    keywords = ['patch']
    message_count = 5.0
    messages = ['238516', '238520', '238584', '238585', '238629']
    nosy_count = 4.0
    nosy_names = ['pitrou', 'vstinner', 'neologix', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue23709'
    versions = ['Python 3.5']

    Activity

    1. vstinner commented on Mar 19, 2015

      @vstinner
      MemberAuthor

      Attached patch enhances ossaudiodev to support buffer larger than 2 GB (replace the C int type with C Py_ssize_t). It uses the new _Py_read() and _Py_write() functions added in the issue bpo-23708 with the Py_buffer API.

      By the way, I don't understand the purpose of the input and output counters (icount and ocount fields of the oss_audio_t structure), they don't look to be used?!

    2. vstinner commented on Mar 19, 2015

      @vstinner
      MemberAuthor

      Oh, I forgot to mention the advantage of using _Py_read() and _Py_write(): they retry read/write when interrupted by a signal, to support the PEP-475.

    3. python-dev commented on Mar 19, 2015

      python-devmannequin
      Mannequin

      New changeset d564695b67bb by Victor Stinner in branch 'default':
      Issue bpo-23709: The ossaudiodev module now retries read/write when interrupted by
      https://hg.python.org/cpython/rev/d564695b67bb

    4. vstinner commented on Mar 19, 2015

      @vstinner
      MemberAuthor

      I commited changes to use _Py_read() and _Py_write().

      I attach an updated patch to use Py_ssize_t instead of int, and to use Py_buffer instead of char*.

    5. python-dev commented on Mar 20, 2015

      python-devmannequin
      Mannequin

      New changeset d478a2a5738a by Victor Stinner in branch 'default':
      Issue bpo-23709, bpo-23001: ossaudiodev now uses Py_ssize_t for sizes instead of int
      https://hg.python.org/cpython/rev/d478a2a5738a

    6. transferred this issue fromon Apr 10, 2022
    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

      No labels
      No labels

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions