[New-bugs-announce] [issue13321] fstat doesn't accept an object with "fileno" method

Matt Joiner report at bugs.python.org
Wed Nov 2 05:04:12 CET 2011


New submission from Matt Joiner <anacrolix at gmail.com>:

os.fstat doesn't not accept an object with the fileno() method.

Probably a bunch of other similar functions will not either.

In some parts of the standard library it's common practice to call PyObject_AsFileDescriptor on fd-wrapping arguments.

http://hg.python.org/cpython/file/d877d7f3b679/Modules/posixmodule.c#l7319
http://hg.python.org/cpython/file/d877d7f3b679/Objects/fileobject.c#l196

----------
components: Library (Lib)
messages: 146823
nosy: anacrolix
priority: normal
severity: normal
status: open
title: fstat doesn't accept an object with "fileno" method
type: behavior
versions: Python 3.2, Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13321>
_______________________________________


More information about the New-bugs-announce mailing list