boakley / robotframework-lint

Linter for robot framework plain text files
Apache License 2.0
126 stars 48 forks source link

invalid continuation byte error #18

Open guykisel opened 9 years ago

guykisel commented 9 years ago
(rflint) ✘-1 /opt/robotframework [master|…1⚑ 1]
12:27 $ python -m rflint ./atest/testdata/standard_libraries/deprecated_os/files/latin-1.txt
+ ./atest/testdata/standard_libraries/deprecated_os/files/latin-1.txt
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/opt/robotframework-lint/rflint/__main__.py", line 5, in <module>
    app.run(sys.argv[1:])
  File "/opt/robotframework-lint/rflint/rflint.py", line 78, in run
    suite = RobotFileFactory(filename)
  File "/opt/robotframework-lint/rflint/parser/parser.py", line 38, in RobotFileFactory
    rf = RobotFile(path, parent)
  File "/opt/robotframework-lint/rflint/parser/parser.py", line 68, in __init__
    self._load(path)
  File "/opt/robotframework-lint/rflint/parser/parser.py", line 86, in _load
    for linenumber, raw_text in enumerate(Utf8Reader(f).readlines()):
  File "/Users/gkisel/.virtualenvs/rflint/lib/python2.7/site-packages/robotframework-2.8.6-py2.7.egg/robot/utils/utf8reader.py", line 44, in readlines
    yield self._decode(line, remove_bom=index == 0)
  File "/Users/gkisel/.virtualenvs/rflint/lib/python2.7/site-packages/robotframework-2.8.6-py2.7.egg/robot/utils/utf8reader.py", line 49, in _decode
    return content.decode('UTF-8')
  File "/Users/gkisel/.virtualenvs/rflint/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe4 in position 3: invalid continuation byte

This looks pretty similar to #13