Issue #26 duplicate

Coverage doesn't work with egg files

Anonymous created an issue

Problem that happens with previous versions too - when it tries to generate a report for a file in a {{{.egg}}} package (zip file) it errors:

{{{

[dbr@schism:~/code/tvnamer]$ coverage html -d htmlcoverage/ Traceback (most recent call last): File "/usr/local/bin/coverage", line 8, in <module> load_entry_point('coverage==3.1b1', 'console_scripts', 'coverage')() File "/Library/Python/2.6/site-packages/coverage-3.1b1-py2.6-macosx-10.6-universal.egg/coverage/cmdline.py", line 558, in main return CoverageScript().command_line(sys.argv[1:]) File "/Library/Python/2.6/site-packages/coverage-3.1b1-py2.6-macosx-10.6-universal.egg/coverage/cmdline.py", line 467, in command_line directory=options.directory, **report_args) File "/Library/Python/2.6/site-packages/coverage-3.1b1-py2.6-macosx-10.6-universal.egg/coverage/control.py", line 322, in html_report morfs, directory=directory, omit_prefixes=omit_prefixes) File "/Library/Python/2.6/site-packages/coverage-3.1b1-py2.6-macosx-10.6-universal.egg/coverage/html.py", line 70, in report self.report_files(self.html_file, morfs, directory, omit_prefixes) File "/Library/Python/2.6/site-packages/coverage-3.1b1-py2.6-macosx-10.6-universal.egg/coverage/report.py", line 54, in report_files report_fn(cu, statements, excluded, missing) File "/Library/Python/2.6/site-packages/coverage-3.1b1-py2.6-macosx-10.6-universal.egg/coverage/html.py", line 88, in html_file source = cu.source_file().read().expandtabs(4) File "/Library/Python/2.6/site-packages/coverage-3.1b1-py2.6-macosx-10.6-universal.egg/coverage/codeunit.py", line 128, in source_file return open(self.filename) IOError: [Errno 20] Not a directory: '/Library/Python/2.6/site-packages/tvdb_api-1.1-py2.6.egg/cache.py'

}}}

Not a huge issue, as I don't usually need the report for the egg, so just do {{{coverage html -d blah *.py}}} or similar

Comments (1)

  1. Log in to comment