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

Argument Clinic: add converter for file descriptor #86151

Closed
serhiy-storchaka opened this issue Oct 9, 2020 · 2 comments
Closed

Argument Clinic: add converter for file descriptor #86151

serhiy-storchaka opened this issue Oct 9, 2020 · 2 comments
Labels
3.10 only security fixes topic-argument-clinic type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 41985
Nosy @larryhastings, @serhiy-storchaka
PRs
  • bpo-41985: Add _PyLong_FileDescriptor_Converter and AC converter for "fildes". #22620
  • 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 2020-10-09.20:01:30.092>
    created_at = <Date 2020-10-09.19:32:31.782>
    labels = ['type-feature', 'expert-argument-clinic', '3.10']
    title = 'Argument Clinic: add converter for file descriptor'
    updated_at = <Date 2020-10-09.20:01:30.090>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2020-10-09.20:01:30.090>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-10-09.20:01:30.092>
    closer = 'serhiy.storchaka'
    components = ['Argument Clinic']
    creation = <Date 2020-10-09.19:32:31.782>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41985
    keywords = ['patch']
    message_count = 2.0
    messages = ['378338', '378345']
    nosy_count = 2.0
    nosy_names = ['larry', 'serhiy.storchaka']
    pr_nums = ['22620']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue41985'
    versions = ['Python 3.10']

    @serhiy-storchaka
    Copy link
    Member Author

    Local converters for file descriptors which uses PyObject_AsFileDescriptor() are defined and used in several files: Modules/fcntlmodule.c, Modules/posixmodule.c, Modules/selectmodule.c, Modules/termios.c.

    The proposed PR replaces them all with a global private function _PyLong_FileDescriptor_Converter() and adds corresponding Argument Clinic converter "fildes".

    In future it could be used in more places, allowing to pass a file with fileno() method to functions which accept file descriptor.

    @serhiy-storchaka serhiy-storchaka added 3.10 only security fixes topic-argument-clinic type-feature A feature request or enhancement labels Oct 9, 2020
    @serhiy-storchaka
    Copy link
    Member Author

    New changeset 9975cc5 by Serhiy Storchaka in branch 'master':
    bpo-41985: Add _PyLong_FileDescriptor_Converter and AC converter for "fildes". (GH-22620)
    9975cc5

    @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 topic-argument-clinic type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant