A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/nedbat/coveragepy/issues/514 below:

path to problem file not reported when encoding declaration error occurs · Issue #514 · nedbat/coveragepy · GitHub

Originally reported by Chris Jerdonek (Bitbucket: cjerdonek, GitHub: cjerdonek)

When I tried running coverage run on a project for the first time, I got the following error. It seems like coverage should be reporting the path of the file it broke on to give users a better clue as to the source of the problem. This is with coverage 4.2 and Python 3.5.2:

Coverage.py warning: No data was collected.
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/tokenize.py", line 392, in find_cookie
    line_string = line.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf5 in position 24: invalid start byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/.../bin/coverage", line 9, in <module>
    load_entry_point('coverage==4.2', 'console_scripts', 'coverage')()
  File "/.../lib/python3.5/site-packages/coverage/cmdline.py", line 753, in main
    status = CoverageScript().command_line(argv)
  File "/.../lib/python3.5/site-packages/coverage/cmdline.py", line 480, in command_line
    return self.do_run(options, args)
  File "/.../lib/python3.5/site-packages/coverage/cmdline.py", line 627, in do_run
    self.run_python_file(filename, args)
  File "/.../lib/python3.5/site-packages/coverage/execfile.py", line 173, in run_python_file
    code = make_code_from_py(filename)
  File "/.../lib/python3.5/site-packages/coverage/execfile.py", line 208, in make_code_from_py
    source = get_python_source(filename)
  File "/.../lib/python3.5/site-packages/coverage/python.py", line 60, in get_python_source
    source = source.decode(source_encoding(source), "replace")
  File "/.../lib/python3.5/site-packages/coverage/phystokens.py", line 262, in _source_encoding_py3
    return tokenize.detect_encoding(readline)[0]
  File "/usr/local/lib/python3.5/tokenize.py", line 433, in detect_encoding
    encoding = find_cookie(first)
  File "/usr/local/lib/python3.5/tokenize.py", line 397, in find_cookie
    raise SyntaxError(msg)
SyntaxError: invalid or missing encoding declaration

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4