[Python-checkins] cpython (merge 3.3 -> default): Issue #13898: test_ssl no longer prints a spurious stack trace on Ubuntu.

nadeem.vawda python-checkins at python.org
Sun Mar 3 22:48:37 CET 2013


http://hg.python.org/cpython/rev/69f737f410f0
changeset:   82464:69f737f410f0
parent:      82461:7ab1c55fcf82
parent:      82463:77cbb3ba5d40
user:        Nadeem Vawda <nadeem.vawda at gmail.com>
date:        Sun Mar 03 22:48:15 2013 +0100
summary:
  Issue #13898: test_ssl no longer prints a spurious stack trace on Ubuntu.

files:
  Lib/test/test_ssl.py |  6 +++++-
  Misc/NEWS            |  2 ++
  2 files changed, 7 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -979,7 +979,11 @@
                     self.sslconn = self.server.context.wrap_socket(
                         self.sock, server_side=True)
                     self.server.selected_protocols.append(self.sslconn.selected_npn_protocol())
-                except ssl.SSLError as e:
+                except (ssl.SSLError, ConnectionResetError) as e:
+                    # We treat ConnectionResetError as though it were an
+                    # SSLError - OpenSSL on Ubuntu abruptly closes the
+                    # connection when asked to use an unsupported protocol.
+                    #
                     # 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
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -887,6 +887,8 @@
 Tests
 -----
 
+- Issue #13898: test_ssl no longer prints a spurious stack trace on Ubuntu.
+
 - Issue #17283: Share code between `__main__.py` and `regrtest.py` in
   `Lib/test`.
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list