Ugly stack trace with --concurrency=multiprocessing with no config file · Issue #1320 · nedbat/coveragepy (original) (raw)

$ coverage run --concurrency=multiprocessing /tmp/thr.py
Traceback (most recent call last):
  File "/usr/local/virtualenvs/coverage/bin/coverage", line 33, in <module>
    sys.exit(load_entry_point('coverage', 'console_scripts', 'coverage')())
  File "/Users/nedbatchelder/coverage/trunk/coverage/cmdline.py", line 945, in main
    status = CoverageScript().command_line(argv)
  File "/Users/nedbatchelder/coverage/trunk/coverage/cmdline.py", line 661, in command_line
    return self.do_run(options, args)
  File "/Users/nedbatchelder/coverage/trunk/coverage/cmdline.py", line 829, in do_run
    self.coverage.start()
  File "/Users/nedbatchelder/coverage/trunk/coverage/control.py", line 573, in start
    self._init_for_start()
  File "/Users/nedbatchelder/coverage/trunk/coverage/control.py", line 465, in _init_for_start
    patch_multiprocessing(rcfile=self.config.config_file)
  File "/Users/nedbatchelder/coverage/trunk/coverage/multiproc.py", line 81, in patch_multiprocessing
    os.environ["COVERAGE_RCFILE"] = os.path.abspath(rcfile)
  File "/usr/local/pyenv/pyenv/versions/3.7.12/lib/python3.7/posixpath.py", line 378, in abspath
    path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not NoneType

Fix this to have a real error message.