[New-bugs-announce] [issue10556] test_zipimport_support mucks up with modules

Antoine Pitrou report at bugs.python.org
Sun Nov 28 00:21:08 CET 2010

New submission from Antoine Pitrou <pitrou at free.fr>:

This test failure is due to test_zipimport_support loading and unloading modules, which leads to them being reloaded. Then the ssl.CertificateError which is checked for by assertRaises isn't the same as the one raised by the module under test (I have printed the type names and ids below):

$ ./python -E -bb -m test.regrtest test_http_cookies test_zipimport_support test_httplib
[1/3] test_http_cookies
[2/3] test_zipimport_support
[3/3] test_httplib
<class 'ssl.CertificateError'> 49243264
<class 'ssl.CertificateError'> 51134640
test test_httplib failed -- Traceback (most recent call last):
  File "/home/antoine/py3k/__svn__/Lib/test/test_httplib.py", line 481, in test_local_bad_hostname
    h.request('GET', '/')
  File "/home/antoine/py3k/__svn__/Lib/http/client.py", line 950, in request
    self._send_request(method, url, body, headers)
  File "/home/antoine/py3k/__svn__/Lib/http/client.py", line 988, in _send_request
  File "/home/antoine/py3k/__svn__/Lib/http/client.py", line 946, in endheaders
  File "/home/antoine/py3k/__svn__/Lib/http/client.py", line 791, in _send_output
  File "/home/antoine/py3k/__svn__/Lib/http/client.py", line 737, in send
  File "/home/antoine/py3k/__svn__/Lib/http/client.py", line 1096, in connect
    ssl.match_hostname(self.sock.getpeercert(), self.host)
  File "/home/antoine/py3k/__svn__/Lib/ssl.py", line 142, in match_hostname
    % (hostname, dnsnames[0]))
ssl.CertificateError: hostname 'localhost' doesn't match 'fakehostname'

(witnessed in http://www.python.org/dev/buildbot/all/builders/AMD64%20Snow%20Leopard%203.x/builds/527/steps/test/logs/stdio )

components: Tests
messages: 122590
nosy: brett.cannon, ncoghlan, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: test_zipimport_support mucks up with modules
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list