Message125253
The following code raise a ValueError('I/O operation on closed file.'):
---
import socket
socket.socket(socket.SOCK_STREAM, socket.AF_INET)
s=socket.socket(socket.SOCK_STREAM, socket.AF_INET)
f=s.makefile("rb")
f.close()
print(repr(f))
---
io.BufferedReader.__repr__() reads self.name (self.buffer.name), but self.buffer is closed.
io.BufferedReader.__repr__() catchs AttributeError when reading self.name. It should also maybe catch ValueError: attached patch does that.
socket.repr(x) returns a string with "[closed]". BufferedReader.repr() should maybe do the same.
Note: TextIOWrapper has the same issue. |
|
Date |
User |
Action |
Args |
2011-01-03 23:51:33 | vstinner | set | recipients:
+ vstinner, pitrou |
2011-01-03 23:51:33 | vstinner | set | messageid: <1294098693.54.0.480300363848.issue10819@psf.upfronthosting.co.za> |
2011-01-03 23:51:31 | vstinner | link | issue10819 messages |
2011-01-03 23:51:31 | vstinner | create | |
|