[issue9177] ssl.read/write on closed socket raises AttributeError

Senko Rasic report at bugs.python.org
Sun Jul 7 15:48:52 CEST 2013


Senko Rasic added the comment:

Here's a patch that adds checks and ValueError raises to SSLSocket.read and SSLSocket.write.

My first attempt was to add the check to _checkClosed to mirror the IOBase._checkClosed, but in SSLSocket its semantics are different (the idea is for the subclass to add custom checks if needed), and it's called from a lot of places that do gracefully handle closed sockets.

So I opted to add it manually to only the read and write methods (which allowed for more specific error messages).

----------
keywords: +patch
nosy: +senko
Added file: http://bugs.python.org/file30844/ssl-socket-readwrite-after-close.diff

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


More information about the Python-bugs-list mailing list