[New-bugs-announce] [issue41985] Argument Clinic: add converter for file descriptor

Serhiy Storchaka report at bugs.python.org
Fri Oct 9 15:32:31 EDT 2020


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

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.

----------
components: Argument Clinic
messages: 378338
nosy: larry, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Argument Clinic: add converter for file descriptor
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41985>
_______________________________________


More information about the New-bugs-announce mailing list