From: Nadeem Vawda Date: Sun, 3 Mar 2013 21:31:21 +0000 (+0100) Subject: Issue #13898: test_ssl no longer prints a spurious stack trace on Ubuntu. X-Git-Tag: v3.2.4rc1~61 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7b39b9b51baf3bc421917083f2b0451c841728bc;p=python Issue #13898: test_ssl no longer prints a spurious stack trace on Ubuntu. --- diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 4f254a98f3..d1cb3f1b84 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -774,7 +774,13 @@ else: try: self.sslconn = self.server.context.wrap_socket( self.sock, server_side=True) - except ssl.SSLError as e: + except (ssl.SSLError, socket.error) as e: + # Treat ECONNRESET as though it were an SSLError - OpenSSL + # on Ubuntu abruptly closes the connection when asked to use + # an unsupported protocol. + if (not isinstance(e, ssl.SSLError) and + e.errno != errno.ECONNRESET): + raise # XXX Various errors can have happened here, for example # a mismatching protocol version, an invalid certificate, # or a low-level bug. This should be made more discriminating. diff --git a/Misc/NEWS b/Misc/NEWS index d3f1ee7a15..a003fe26a5 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -947,6 +947,8 @@ Extension Modules Tests ----- +- Issue #13898: test_ssl no longer prints a spurious stack trace on Ubuntu. + - Issue #17249: convert a test in test_capi to use unittest and reap threads. - Issue #17041: Fix testing when Python is configured with the