"./python Lib/test/regrtest.py test_zipimport_support" pass, but not with the -R option. ---- $ ./python Lib/test/regrtest.py -R 3:3: test_zipimport_support [1/1] test_zipimport_support beginning 6 repetitions 123456 test test_zipimport_support failed -- Traceback (most recent call last): File "/home/haypo/prog/SVN/py3k/Lib/test/test_zipimport_support.py", line 96, in test_inspect_getsource_issue4223 self.assertEqual(inspect.getsource(zip_pkg.foo), test_src) File "/home/haypo/prog/SVN/py3k/Lib/inspect.py", line 693, in getsource lines, lnum = getsourcelines(object) File "/home/haypo/prog/SVN/py3k/Lib/inspect.py", line 682, in getsourcelines lines, lnum = findsource(object) File "/home/haypo/prog/SVN/py3k/Lib/inspect.py", line 530, in findsource raise IOError('could not get source code') IOError: could not get source code 1 test failed: test_zipimport_support ----
My fix for the issues with reloading of the _ssl module meant that a couple of temporary modules weren't getting cleared out of sys.modules properly, thus confusing the second and later runs of affected tests. Attached patch adds explicit removal calls for the affected modules.