incorrect path to orphaned .pyc files · Issue #60 · nedbat/coveragepy (original) (raw)

Originally reported by Zooko O'Whielacronx (Bitbucket: zooko, GitHub: zooko)


If you have a .pyc file with no corresponding .py file then coverage.py will print out an error message and stop generation of the HTML output. The problem is that the error message gives the wrong path to the module -- using the CWD instead of the actual location of the .pyc file.

No source for code: '/Users/wade/src/simplegeo/SG/init.py'

In this case it turned out to have nothing to do with /Users/wade/src/simplegeo/SG - there was actually an orphaned __init__.pyc file in a different directory that was also in the PYTHONPATH.

As a bonus it would be nice if coverage.py could detect that the problem is a present .pyc file and absent .py file, but at least if it reports correct information about the path/name of the broken module that would make it easier for users to figure out their problem.