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.

Title: python Lib/test/ -R 3:3: test_zipimport_support fails
Type: Stage:
Components: Tests Versions: Python 3.2
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: brett.cannon, ncoghlan, vstinner
Priority: normal Keywords:

Created on 2011-01-21 11:14 by vstinner, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit
issue10971_temp_module_cleanup.diff ncoghlan, 2011-02-06 15:57 Remove temp modules from module cache
Messages (5)
msg126718 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-01-21 11:14
"./python Lib/test/ test_zipimport_support" pass, but not with the -R option.

$ ./python Lib/test/ -R 3:3: test_zipimport_support
[1/1] test_zipimport_support
beginning 6 repetitions
test test_zipimport_support failed -- Traceback (most recent call last):
  File "/home/haypo/prog/SVN/py3k/Lib/test/", line 96, in test_inspect_getsource_issue4223
    self.assertEqual(inspect.getsource(, test_src)
  File "/home/haypo/prog/SVN/py3k/Lib/", line 693, in getsource
    lines, lnum = getsourcelines(object)
  File "/home/haypo/prog/SVN/py3k/Lib/", line 682, in getsourcelines
    lines, lnum = findsource(object)
  File "/home/haypo/prog/SVN/py3k/Lib/", line 530, in findsource
    raise IOError('could not get source code')
IOError: could not get source code

1 test failed:
msg128063 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2011-02-06 15:57
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.
msg128064 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2011-02-06 15:57
Helps to add the patch rather than the whole file...
msg128120 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2011-02-07 14:54
Fixed for 3.2 in r88368 (no backport needed, since the older test suites didn't exhibit the original problem with the _ssl module reloading)
msg128121 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2011-02-07 14:57
(Georg reviewed the patch after I mentioned it to him on IRC)
Date User Action Args
2022-04-11 14:57:11adminsetgithub: 55180
2011-02-07 14:57:02ncoghlansetnosy: brett.cannon, ncoghlan, vstinner
messages: + msg128121
2011-02-07 14:54:38ncoghlansetstatus: open -> closed

messages: + msg128120
resolution: fixed
nosy: brett.cannon, ncoghlan, vstinner
2011-02-06 15:58:04ncoghlansetfiles: -
nosy: brett.cannon, ncoghlan, vstinner
2011-02-06 15:57:57ncoghlansetfiles: + issue10971_temp_module_cleanup.diff
nosy: brett.cannon, ncoghlan, vstinner
messages: + msg128064
2011-02-06 15:57:07ncoghlansetfiles: +
nosy: brett.cannon, ncoghlan, vstinner
messages: + msg128063
2011-02-06 15:22:36pitrousetnosy: + ncoghlan
2011-02-06 10:32:01vstinnersetnosy: + brett.cannon
2011-01-21 11:14:42vstinnercreate