summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ftplib.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-03-22 14:49:10 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-03-22 14:49:10 (GMT)
commit5733c08f55e9bf1ff5ac79908d941581feafea57 (patch)
treef0f7d64783ed07d6804f63cef4999b9d2d634a4e /Lib/test/test_ftplib.py
parent808fc0a0eea56dd4ef2fa9f9dee00ef0c20760f2 (diff)
downloadcpython-5733c08f55e9bf1ff5ac79908d941581feafea57.zip
cpython-5733c08f55e9bf1ff5ac79908d941581feafea57.tar.gz
cpython-5733c08f55e9bf1ff5ac79908d941581feafea57.tar.bz2
Merged revisions 79226,79286 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r79226 | antoine.pitrou | 2010-03-21 20:33:38 +0100 (dim., 21 mars 2010) | 4 lines Issue #3890: Fix recv() and recv_into() on non-blocking SSL sockets. ........ r79286 | antoine.pitrou | 2010-03-22 15:41:48 +0100 (lun., 22 mars 2010) | 3 lines Fix an occasional test_ftplib failure, following r79226. ........
Diffstat (limited to 'Lib/test/test_ftplib.py')
-rw-r--r--Lib/test/test_ftplib.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py
index 2ed1e5f..29f7f7d 100644
--- a/Lib/test/test_ftplib.py
+++ b/Lib/test/test_ftplib.py
@@ -296,7 +296,9 @@ if ssl is not None:
try:
return super(SSLConnection, self).send(data)
except ssl.SSLError as err:
- if err.args[0] in (ssl.SSL_ERROR_EOF, ssl.SSL_ERROR_ZERO_RETURN):
+ if err.args[0] in (ssl.SSL_ERROR_EOF, ssl.SSL_ERROR_ZERO_RETURN,
+ ssl.SSL_ERROR_WANT_READ,
+ ssl.SSL_ERROR_WANT_WRITE):
return 0
raise
@@ -304,6 +306,9 @@ if ssl is not None:
try:
return super(SSLConnection, self).recv(buffer_size)
except ssl.SSLError as err:
+ if err.args[0] in (ssl.SSL_ERROR_WANT_READ,
+ ssl.SSL_ERROR_WANT_WRITE):
+ return ''
if err.args[0] in (ssl.SSL_ERROR_EOF, ssl.SSL_ERROR_ZERO_RETURN):
self.handle_close()
return b''