`IOError` encountered opening file hidden by `AttributeError`
Currently if you hit a permission problem on a file (or at least that's my best guess of what went wrong on AppVeyor), you get:
Traceback (most recent call last):
File "C:\Miniconda\envs\_test\Scripts\flake8-script.py", line 11, in <module>
load_entry_point('flake8==3.2.1', 'console_scripts', 'flake8')()
File "C:\Miniconda\envs\_test\lib\site-packages\flake8\main\cli.py", line 16, in main
app.run(argv)
File "C:\Miniconda\envs\_test\lib\site-packages\flake8\main\application.py", line 322, in run
self._run(argv)
File "C:\Miniconda\envs\_test\lib\site-packages\flake8\main\application.py", line 306, in _run
self.run_checks()
File "C:\Miniconda\envs\_test\lib\site-packages\flake8\main\application.py", line 243, in run_checks
self.file_checker_manager.start(files)
File "C:\Miniconda\envs\_test\lib\site-packages\flake8\checker.py", line 371, in start
self.make_checkers(paths)
File "C:\Miniconda\envs\_test\lib\site-packages\flake8\checker.py", line 285, in make_checkers
if argument == filename or should_create_file_checker(filename)
File "C:\Miniconda\envs\_test\lib\site-packages\flake8\checker.py", line 412, in __init__
self.display_name = self.processor.filename
AttributeError: 'NoneType' object has no attribute 'filename'
This is due to the combination of setting FileChecker.display_name
to self.processor.filename
at https://gitlab.com/pycqa/flake8/blob/master/src/flake8/checker.py#L412 and the fact that FileChecker._make_processor()
returns None
in the error path at https://gitlab.com/pycqa/flake8/blob/master/src/flake8/checker.py#L412.
Not the cause of my problem, but it keeps me from ever seeing the error message from IOError
.