[New-bugs-announce] [issue18082] Inconsistent behavior of IOBase methods on closed files
report at bugs.python.org
Tue May 28 18:31:28 CEST 2013
New submission from Dwight Guth:
Consider the following program:
self.x = 5
def read(self, limit=-1):
self.x -= 1
if self.x > 0:
def seek(self, offset, whence=0):
def write(self, b):
a = A()
assert a.__next__() == b"5555"
assert a.readline() == b""
assert a.tell() == 0
These three operations succeed, even though the file is closed. However, these two operations fail:
Why do some of the mixin methods on IOBase call _checkClosed and others don't?
title: Inconsistent behavior of IOBase methods on closed files
versions: Python 3.3
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce