New submission from Larry Hastings:

While working on posixmodule.c today I noticed that some functions that accept 
file descriptors call PyObject_AsFileDescriptor().  This function accepts ints. 
 It *also* accepts objects that expose a .fileno() attribute, calling that 
attribute and using the integer it returns.

There are *other* functions in posixmodule.c that accept file descriptors that 
call _fd_converter(), which just looks for an int with a proper value.

I figure it should be one way or the other.  Should everything in posix that 
accepts file descriptor ints accept the .fileno() convention too?

----------
messages: 209613
nosy: larry
priority: low
severity: normal
stage: needs patch
status: open
title: Should posix functions that accept fd also accept objects with .fileno()?
type: enhancement
versions: Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20431>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to