summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/ssl.py23
-rw-r--r--Misc/NEWS2
2 files changed, 6 insertions, 19 deletions
diff --git a/Lib/ssl.py b/Lib/ssl.py
index b1cc149..ebb11b4 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -240,16 +240,9 @@ class SSLSocket(socket):
if self._sslobj:
if flags != 0:
raise ValueError(
- "non-zero flags not allowed in calls to recv_into() on %s" %
- self.__class__)
- while True:
- try:
- return self.read(buflen)
- except SSLError as x:
- if x.args[0] == SSL_ERROR_WANT_READ:
- continue
- else:
- raise x
+ "non-zero flags not allowed in calls to recv() on %s" %
+ self.__class__)
+ return self.read(buflen)
else:
return socket.recv(self, buflen, flags)
@@ -264,15 +257,7 @@ class SSLSocket(socket):
raise ValueError(
"non-zero flags not allowed in calls to recv_into() on %s" %
self.__class__)
- while True:
- try:
- v = self.read(nbytes, buffer)
- return v
- except SSLError as x:
- if x.args[0] == SSL_ERROR_WANT_READ:
- continue
- else:
- raise x
+ return self.read(nbytes, buffer)
else:
return socket.recv_into(self, buffer, nbytes, flags)
diff --git a/Misc/NEWS b/Misc/NEWS
index 3a9a641..1c329dd 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -17,6 +17,8 @@ Core and Builtins
Library
-------
+- Issue #3890: Fix recv() and recv_into() on non-blocking SSL sockets.
+
- Issue #6716/2: Backslash-replace error output in compilall.
Build