This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients martin.panter
Date 2016-01-21.10:46:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1453373183.85.0.754157160572.issue26173@psf.upfronthosting.co.za>
In-reply-to
Content
In bad_cert_test(), there are two OSError exception handler; one masking the other. In Python 3, I think we should remove the second (dead) handler. In Python 2, maybe the first OSError handler should catch socket.error instead.

Originally, in r80534, socket.error was caught and ignored, with the vague explanation “socket.error can really happen here”. Then revision 9297974604ff added an IOError handler, presumably to catch ENOENT for test_nonexisting_cert().

Later, in revisions 50d19c2fac82 and 9297974604ff, socket.error and IOError were both changed to OSError. I guess in Python 3 we should just catch all OSError exceptions and remove the second handler that only wants ENOENT.

In Python 2, there was a large backport of SSL functionality in revision 221a1f9155e2 (Issue 21308). It seems to have brought too much of the OSError alias changes with it. This is probably the cause of the following 2.7 builtbot failure:

http://buildbot.python.org/all/builders/x86%20XP-4%202.7/builds/3580/steps/test/logs/stdio
======================================================================
ERROR: test_nonexisting_cert (test.test_ssl.ThreadedTests)
Connecting with a non-existing cert file
----------------------------------------------------------------------
Traceback (most recent call last):
  File "d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\test\test_ssl.py", line 2153, in test_nonexisting_cert
    "wrongcert.pem"))
  File "d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\test\test_ssl.py", line 1889, in bad_cert_test
    s.connect((HOST, server.port))
  File "d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\ssl.py", line 844, in connect
    self._real_connect(addr, False)
  File "d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\ssl.py", line 835, in _real_connect
    self.do_handshake()
  File "d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\ssl.py", line 808, in do_handshake
    self._sslobj.do_handshake()
error: [Errno 10054] An existing connection was forcibly closed by the remote host

Errno 10054 is apparently ECONNRESET.
History
Date User Action Args
2016-01-21 10:46:23martin.pantersetrecipients: + martin.panter
2016-01-21 10:46:23martin.pantersetmessageid: <1453373183.85.0.754157160572.issue26173@psf.upfronthosting.co.za>
2016-01-21 10:46:23martin.panterlinkissue26173 messages
2016-01-21 10:46:23martin.pantercreate