Roundup Robot added the comment:
New changeset fad797916266 by Antoine Pitrou in branch '3.2':
Issue #15842: the SocketIO.{readable,writable,seekable} methods now raise
ValueError when the file-like object is closed.
http://hg.python.org/cpython/rev/fad797916266
New changeset 3b0e20f71d8a by
Antoine Pitrou added the comment:
Ok, I've committed the patch. Thanks Alessandro!
--
resolution: - fixed
stage: - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15842
Antoine Pitrou added the comment:
Actually, I've found a couple of issues with the patch:
- it doesn't address seekable(); seekable() should also raise ValueError
- the test should be done with makefile(..., buffering=0), so that SocketIO is
actually tested, rather than the buffered object
Alessandro Moura added the comment:
Fixed seekable(), and amended tests; see patch.
--
Added file: http://bugs.python.org/file27149/socket.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15842
Alessandro Moura added the comment:
This patch fixes the problem, making those methods raise a ValueError exception
after close.
I also added one test case for this issue.
--
keywords: +patch
nosy: +eng793
Added file: http://bugs.python.org/file27128/socket.patch
New submission from Antoine Pitrou:
import socket
s = socket.socket()
f = s.makefile(rb, buffering=0)
f
socket.SocketIO object at 0x7f2f323cd790
f.close()
f.writable()
False
f.readable()
False
--
components: IO, Library (Lib)
messages: 169666
nosy: benjamin.peterson, hynek,