[New-bugs-announce] [issue15261] os.stat(fd) crashes on Windows if fd does not exist

Richard Oudkerk report at bugs.python.org
Fri Jul 6 02:03:26 CEST 2012


New submission from Richard Oudkerk <shibturn at gmail.com>:

In Python 3.3 (but not earlier) os.stat() is documented to work with file descriptors.  (os.path.exists() also works with fds since it is implemented in terms of os.stat(), although that is *not* documented.)

However, on Windows if fd is not open then os.stat(fd) triggers an assertion error or crash:

  File: f:\dd\vctools\crt_bld\self_x86\crt\src\osfinfo.c
  Line: 316
  Expression: (_osfile(fh) & FOPEN)

Note that os.fstat() fails on Windows with OSError(EBADF, ...).

----------
messages: 164705
nosy: sbt
priority: high
severity: normal
stage: needs patch
status: open
title: os.stat(fd) crashes on Windows if fd does not exist
type: crash
versions: Python 3.3

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


More information about the New-bugs-announce mailing list