Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_iter_importers intermittent failure in test_pkgutil #61931

Closed
bitdancer opened this issue Apr 14, 2013 · 5 comments
Closed

test_iter_importers intermittent failure in test_pkgutil #61931

bitdancer opened this issue Apr 14, 2013 · 5 comments
Assignees
Labels
type-bug An unexpected behavior, bug, or error

Comments

@bitdancer
Copy link
Member

BPO 17731
Nosy @ncoghlan, @ezio-melotti, @bitdancer, @berkerpeksag
Files
  • test_order_issue17731.txt: Interim test file for bisection
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/ncoghlan'
    closed_at = <Date 2013-04-15.12:58:07.100>
    created_at = <Date 2013-04-14.17:52:55.066>
    labels = ['type-bug']
    title = 'test_iter_importers intermittent failure in test_pkgutil'
    updated_at = <Date 2013-04-15.12:58:07.087>
    user = 'https://github.com/bitdancer'

    bugs.python.org fields:

    activity = <Date 2013-04-15.12:58:07.087>
    actor = 'python-dev'
    assignee = 'ncoghlan'
    closed = True
    closed_date = <Date 2013-04-15.12:58:07.100>
    closer = 'python-dev'
    components = []
    creation = <Date 2013-04-14.17:52:55.066>
    creator = 'r.david.murray'
    dependencies = []
    files = ['29861']
    hgrepos = []
    issue_num = 17731
    keywords = ['buildbot']
    message_count = 5.0
    messages = ['186938', '186939', '186977', '186980', '186984']
    nosy_count = 5.0
    nosy_names = ['ncoghlan', 'ezio.melotti', 'r.david.murray', 'python-dev', 'berker.peksag']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue17731'
    versions = ['Python 3.3', 'Python 3.4']

    @bitdancer
    Copy link
    Member Author

    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'

    @bitdancer bitdancer added the type-bug An unexpected behavior, bug, or error label Apr 14, 2013
    @ncoghlan ncoghlan self-assigned this Apr 15, 2013
    @ncoghlan
    Copy link
    Contributor

    "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#"

    @ncoghlan
    Copy link
    Contributor

    Created bpo-17734 for the weird interference between test_genexps and test_builtin

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Apr 15, 2013

    New changeset 73c79022977b by Nick Coghlan in branch '3.3':
    Close bpo-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 bpo-17731 from 3.3
    http://hg.python.org/cpython/rev/5d4001e32a31

    @python-dev python-dev mannequin closed this as completed Apr 15, 2013
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants