classification
Title: Argument Clinic: add converter for file descriptor
Type: enhancement Stage: resolved
Components: Argument Clinic Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: larry, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2020-10-09 19:32 by serhiy.storchaka, last changed 2020-10-09 20:01 by serhiy.storchaka. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 22620 merged serhiy.storchaka, 2020-10-09 19:38
Messages (2)
msg378338 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-10-09 19:32
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.
msg378345 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-10-09 20:00
New changeset 9975cc5008c795e069ce11e2dbed2110cc12e74e by Serhiy Storchaka in branch 'master':
bpo-41985: Add _PyLong_FileDescriptor_Converter and AC converter for "fildes". (GH-22620)
https://github.com/python/cpython/commit/9975cc5008c795e069ce11e2dbed2110cc12e74e
History
Date User Action Args
2020-10-09 20:01:30serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-10-09 20:00:52serhiy.storchakasetmessages: + msg378345
2020-10-09 19:38:08serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request21600
2020-10-09 19:32:31serhiy.storchakacreate