[issue18082] Inconsistent behavior of IOBase methods on closed files

2013-05-28 Thread Dwight Guth
New submission from Dwight Guth: Consider the following program: import io class A(io.IOBase): def __init__(self): self.x = 5 def read(self, limit=-1): self.x -= 1 if self.x > 0: return b"5" return b"" def seek(self, offset, whence=0

[issue15903] Make rawiobase_read() read directly to bytes object

2013-06-01 Thread Dwight Guth
Dwight Guth added the comment: I was programming something today and thought I should let you know I came across a situation where the current behavior of this function is able to expose what seems to be raw memory to the user. import io class A(io.RawIOBase): def readinto(self, b

[issue17983] global __class__ statement in class declaration

2013-05-15 Thread Dwight Guth
New submission from Dwight Guth: The following python program causes cpython to crash: class A: global __class__ def a(self): super() I get the following output on the console: bug.py:2: SyntaxWarning: name '__class__' is assigned to before global declaration global