Coverage doesn't work with egg files

Issue #26 duplicate
Former user 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/", 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/", line 467, in command_line, **report_args) File "/Library/Python/2.6/site-packages/coverage-3.1b1-py2.6-macosx-10.6-universal.egg/coverage/", 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/", 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/", 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/", 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/", 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/'


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. Ned Batchelder repo owner

    There must be something eggy in the air: no one mentioned this in the last six months, now I get two reports of it on the same day!

    Duplicate of #25.

  2. Log in to comment