Coverage won't run pyc files

Issue #264 resolved
Ned Batchelder repo owner created an issue

Trying to run a .pyc file produces this: warning: No data was collected.
Traceback (most recent call last):
  File "/usr/local/pythonz/pythons/CPython-2.7.5/lib/python2.7/", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/local/pythonz/pythons/CPython-2.7.5/lib/python2.7/", line 72, in _run_code
    exec code in run_globals
  File "/Users/ned/coverage/trunk/coverage/", line 4, in <module>
  File "coverage/", line 720, in main
    status = CoverageScript().command_line(argv)
  File "coverage/", line 438, in command_line
    self.do_execute(options, args)
  File "coverage/", line 575, in do_execute
    self.run_python_file(filename, args)
  File "coverage/", line 111, in run_python_file
    code = compile(source, filename, "exec")
TypeError: compile() expected string without null bytes

Note that Python will also execute a .pyc file renamed to something else like .xxx

Comments (1)

  1. Log in to comment