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.

classification
Title: test_iter_importers intermittent failure in test_pkgutil
Type: behavior Stage: resolved
Components: Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ncoghlan Nosy List: berker.peksag, ezio.melotti, ncoghlan, python-dev, r.david.murray
Priority: normal Keywords: buildbot

Created on 2013-04-14 17:52 by r.david.murray, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_order_issue17731.txt ncoghlan, 2013-04-15 12:14 Interim test file for bisection
Messages (5)
msg186938 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-04-14 17:52
A buildbot produced the following traceback, but the test passed when re-run.  

http://buildbot.python.org/all/builders/x86%20Gentoo%203.3/builds/630/steps/test/logs/stdio

test_loader_deprecated (test.test_pkgutil.ImportlibMigrationTests) ... ok

======================================================================
ERROR: test_iter_importers (test.test_pkgutil.ExtendPathTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 1521, in _find_and_load_unlocked
AttributeError: 'module' object has no attribute '__path__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/buildslave/3.3.murray-gentoo/build/Lib/test/test_pkgutil.py", line 206, in test_iter_importers
    importlib.import_module(fullname)
  File "/var/lib/buildslave/3.3.murray-gentoo/build/Lib/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1586, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1567, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1524, in _find_and_load_unlocked
ImportError: No module named 'spam.eggs'; spam is not a package

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/buildslave/3.3.murray-gentoo/build/Lib/test/test_pkgutil.py", line 226, in test_iter_importers
    del sys.modules['spam.eggs']
KeyError: 'spam.eggs'
msg186939 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-04-14 17:57
This is related to #16163.
Other buildbots failed too, e.g.:
http://buildbot.python.org/all/builders/x86%20RHEL%206%203.3/builds/501
http://buildbot.python.org/all/builders/x86%20Gentoo%20Non-Debug%203.x/builds/4128
http://buildbot.python.org/all/builders/AMD64%20Fedora%20without%20threads%203.3/builds/648
msg186977 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2013-04-15 12:14
"spam" is a fairly generic name, so I'm guessing something else is leaving a "spam" module around in sys.modules - when I run the tests with the order given in RDM's original report, I get the same error.

I also get a failure in test_builtin though, which is a little weird.

With the attached file, test_builtin fails (so one of the uncommented tests appears to be interfering with that), while test_pkgutil passes (suggesting that the problem there is one the tests flagged with "#TEMP#"
msg186980 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2013-04-15 12:40
Created #17734 for the weird interference between test_genexps and test_builtin
msg186984 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-04-15 12:58
New changeset 73c79022977b by Nick Coghlan in branch '3.3':
Close #17731: Clean up properly in test_import
http://hg.python.org/cpython/rev/73c79022977b

New changeset 5d4001e32a31 by Nick Coghlan in branch 'default':
Merge fix for #17731 from 3.3
http://hg.python.org/cpython/rev/5d4001e32a31
History
Date User Action Args
2022-04-11 14:57:44adminsetgithub: 61931
2013-04-15 12:58:07python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg186984

resolution: fixed
stage: needs patch -> resolved
2013-04-15 12:40:47ncoghlansetmessages: + msg186980
2013-04-15 12:14:27ncoghlansetfiles: + test_order_issue17731.txt

messages: + msg186977
2013-04-15 10:51:51ncoghlansetassignee: ncoghlan
2013-04-14 17:57:59ezio.melottisetversions: + Python 3.3, Python 3.4
nosy: + ezio.melotti, berker.peksag

messages: + msg186939

stage: needs patch
2013-04-14 17:52:55r.david.murraycreate