Skip to content

AttributeError: 'module' object has no attribute '__path__' #410

@nedbat

Description

@nedbat

This seems to happen on py 3.4+ with unusual imports.

Here's a failing Travis build: https://travis-ci.org/mgedmin/irclog2html/jobs/81338508

#!python
$ coverage run --source=irclog2html -m zope.testrunner.__init__ --test-path=src
Coverage.py warning: Module irclog2html was never imported.
Coverage.py warning: No data was collected.
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.4.2/bin/coverage", line 9, in <module>
    load_entry_point('coverage==4.0', 'console_scripts', 'coverage')()
  File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/coverage/cmdline.py", line 694, in main
    status = CoverageScript().command_line(argv)
  File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/coverage/cmdline.py", line 435, in command_line
    return self.do_run(options, args)
  File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/coverage/cmdline.py", line 569, in do_run
    self.run_python_module(args[0], args)
  File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/coverage/execfile.py", line 107, in run_python_module
    pathname, packagename = find_module(modulename)
  File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/coverage/execfile.py", line 44, in find_module
    spec = importlib_util_find_spec(mod_main)
  File "/home/travis/virtualenv/python3.4.2/lib/python3.4/importlib/util.py", line 87, in find_spec
    return _find_spec(fullname, parent.__path__)
AttributeError: 'module' object has no attribute '__path__'

It should be reproducible by checking out https://github.com/mgedmin/irclog2html/tree/2154cf870f3073a71471bb2863be64827c3d90c1 and then running "tox -e py34"


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requestedrun

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions