Skip to content

coverage run --debug=sys fails with: 'CoverageData' object has no attribute 'filename' #907

@nedbat

Description

@nedbat
$ coverage run --debug=sys foo.py
Traceback (most recent call last):
  File ".tox/py36/bin/coverage", line 11, in <module>
    load_entry_point('coverage', 'console_scripts', 'coverage')()
  File "/Users/ned/coverage/trunk/coverage/cmdline.py", line 824, in main
    status = CoverageScript().command_line(argv)
  File "/Users/ned/coverage/trunk/coverage/cmdline.py", line 555, in command_line
    return self.do_run(options, args)
  File "/Users/ned/coverage/trunk/coverage/cmdline.py", line 700, in do_run
    self.coverage.start()
  File "/Users/ned/coverage/trunk/coverage/control.py", line 516, in start
    self._post_init()
  File "/Users/ned/coverage/trunk/coverage/control.py", line 282, in _post_init
    self._write_startup_debug()
  File "/Users/ned/coverage/trunk/coverage/control.py", line 300, in _write_startup_debug
    write_formatted_info(self._debug, "sys", self.sys_info())
  File "/Users/ned/coverage/trunk/coverage/control.py", line 1008, in sys_info
    ('data_file', self._data.filename if self._data else "-none-"),
AttributeError: 'CoverageData' object has no attribute 'filename'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixed

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions