1. Mikhail Korobov
  2. django-coverage
  3. Issues
Issue #10 new

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

Jeff Bauer
created an issue

Just a quick traceback dump before I forget to submit a bug ticket. ;-)

I'm running this as a non-app:
{{{./manage.py test }}}

{{{ Traceback (most recent call last): File "manage.py", line 11, in <module> execute_manager(settings) File "/home/jbauer/.virtualenvs/py272/lib/python2.7/site-packages/django/core/management/init.py", line 438, in execute_manager utility.execute() File "/home/jbauer/.virtualenvs/py272/lib/python2.7/site-packages/django/core/management/init.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/jbauer/.virtualenvs/py272/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv self.execute(*args, options.__dict__) File "/home/jbauer/.virtualenvs/py272/lib/python2.7/site-packages/django/core/management/base.py", line 220, in execute output = self.handle(*args, options) File "/home/jbauer/.virtualenvs/py272/lib/python2.7/site-packages/django/core/management/commands/test.py", line 37, in handle failures = test_runner.run_tests(test_labels) File "/home/jbauer/.virtualenvs/py272/lib/python2.7/site-packages/django_coverage/coverage_runner.py", line 90, in run_tests settings.COVERAGE_PATH_EXCLUDES) File "/home/jbauer/.virtualenvs/py272/lib/python2.7/site-packages/django_coverage/utils/module_tools/module_walker.py", line 133, in get_all_modules _get_all_modules(pkg_name, pkg, blacklist) File "/home/jbauer/.virtualenvs/py272/lib/python2.7/site-packages/django_coverage/utils/module_tools/module_walker.py", line 112, in _get_all_modules for p in pkg.path: AttributeError: 'module' object has no attribute 'path' }}}

Comments (3)

  1. Terr

    I had the same problem. Turns out I had an (old, empty) directory with the same name as a Python package (permissions/, permissions.py[c]). The directory didn't contain a init.py, so I'm not sure why it was identified as a package.

    Deleting the directory fixed the problem, but improving package detection code would be better of course.

  2. Log in to comment