[issue20951] SSLSocket.send() returns 0 for non-blocking socket

Nikolaus Rath report at bugs.python.org
Fri Mar 21 01:48:13 CET 2014


Nikolaus Rath added the comment:

I'd like to argue with the wise words of Nick Coghlan here:

--snip--
There's a great saying in the usability world: "You can't document your way out of a usability problem". What it means is that if all the affordances of your application (or programming language!) push users towards a particular logical conclusion ([...]), having a caveat in your documentation isn't going to help, because people aren't even going to think to ask the question. It doesn't matter if you originally had a good reason for the behaviour, you've ended up in a place where your behaviour is confusing and inconsistent, because there is one piece of behaviour that is out of line with an otherwise consistent mental model. 
--snip--

This was said in context of the bool(datetime.time) discussion, but I think it applies here as well. The rest of Python consistently raises an exception when something would block in non-blocking mode. This is reasonable behavior to expect. I agree that we shouldn't suddenly break this, but emitting a deprecation warning in Python 3.5, and changing the default in 3.6 seems reasonable to me. This is three years of transition time, and based on my random sampling so far, I doubt that there are a lot of affected modules or applications.

----------

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


More information about the Python-bugs-list mailing list