[New-bugs-announce] [issue15904] file, close() can fail assert on Windows in 2.7

Richard Oudkerk report at bugs.python.org
Mon Sep 10 16:16:38 CEST 2012


New submission from Richard Oudkerk:

With Python 2.7 on Windows the following crashes with an assertion:

    >>> import os
    [43042 refs]
    >>> f = open("foobar", "wb")
    [43048 refs]
    >>> os.close(f.fileno())
    [43048 refs]
    >>> f.close()
    <Failed assertion>

A box pops up with

    Program: C:\Repos\cpython-27\PCbuild\python_d.exe
    File: f:\dd\vctools\crt_bld\self_x86\crt\src\close.c
    Line: 48

    Expression: (_osfile(fh) & FOPEN)

Python 3.2 and 3.3 give IOError(EBADF, ...) as expected.

Compare #15261 and #15263.

----------
messages: 170188
nosy: sbt
priority: normal
severity: normal
stage: needs patch
status: open
title: file,close() can fail assert on Windows in 2.7
type: crash
versions: Python 2.7

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


More information about the New-bugs-announce mailing list