当我的文件中的所有单词都是英文时,一切顺利,但当我使用"打印("你好")"等代码时,甚至使用类似的评论"#你好",然后flake8停止工作,只显示"抛出异常。见ALEDetail"在第一行。[我在vim80中使用w0rp / ale作为插件]
如果我在vim中输入:ALEDetail,信息如下所示:
Traceback (most recent call last):
File "d:\programmingtool\python\python35\lib\site-packages\flake8\utils.py", line 82, in _stdin_get_value_py3
return io.StringIO(stdin_value.decode(coding))
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 92: invalid start byte
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "d:\programmingtool\python\python35\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "d:\programmingtool\python\python35\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\ProgrammingTool\python\python35\Scripts\flake8.exe\__main__.py", line 9, in <module>
File "d:\programmingtool\python\python35\lib\site-packages\flake8\main\cli.py", line 16, in main
app.run(argv)
File "d:\programmingtool\python\python35\lib\site-packages\flake8\main\application.py", line 396, in run
self._run(argv)
File "d:\programmingtool\python\python35\lib\site-packages\flake8\main\application.py", line 384, in _run
self.run_checks()
File "d:\programmingtool\python\python35\lib\site-packages\flake8\main\application.py", line 309, in run_checks
self.file_checker_manager.start(files)
File "d:\programmingtool\python\python35\lib\site-packages\flake8\checker.py", line 342, in start
self.make_checkers(paths)
File "d:\programmingtool\python\python35\lib\site-packages\flake8\checker.py", line 246, in make_checkers
checker for checker in checkers if checker.should_process
File "d:\programmingtool\python\python35\lib\site-packages\flake8\checker.py", line 246, in <listcomp>
checker for checker in checkers if checker.should_process
File "d:\programmingtool\python\python35\lib\site-packages\flake8\checker.py", line 243, in <genexpr>
if should_create_file_checker(filename, argument)
File "d:\programmingtool\python\python35\lib\site-packages\flake8\checker.py", line 378, in __init__
self.processor = self._make_processor()
File "d:\programmingtool\python\python35\lib\site-packages\flake8\checker.py", line 392, in _make_processor
return processor.FileProcessor(self.filename, self.options)
File "d:\programmingtool\python\python35\lib\site-packages\flake8\processor.py", line 61, in __init__
self.lines = self.read_lines()
File "d:\programmingtool\python\python35\lib\site-packages\flake8\processor.py", line 297, in read_lines
lines = self.read_lines_from_stdin()
File "d:\programmingtool\python\python35\lib\site-packages\flake8\processor.py", line 333, in read_lines_from_stdin
return utils.stdin_get_value().splitlines(True)
File "d:\programmingtool\python\python35\lib\site-packages\flake8\utils.py", line 95, in stdin_get_value
stdin_value = _stdin_get_value_py3()
File "d:\programmingtool\python\python35\lib\site-packages\flake8\utils.py", line 84, in _stdin_get_value_py3
return io.StringIO(stdin_value.decode('utf-8'))
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 92: invalid start byte