JetBrains / teamcity-messages

Python Unit Test Reporting to TeamCity
https://pypi.python.org/pypi/teamcity-messages
Apache License 2.0
137 stars 81 forks source link

flake8_v3_plugin fails if file have no encoding at the start of the file #208

Open freakaton opened 5 years ago

freakaton commented 5 years ago

python==3.6 flake8==3.7.6 teamcity-messages==1.21

Traceback (most recent call last):
      File "/home/ubuntu/virtualenvs/d70c332e20daa20d-lLnGEZoM/bin/flake8", line 10, in <module>
        sys.exit(main())
      File "/home/ubuntu/virtualenvs/d70c332e20daa20d-lLnGEZoM/lib/python3.6/site-packages/flake8/main/cli.py", line 18, in main
        app.run(argv)
      File "/home/ubuntu/virtualenvs/d70c332e20daa20d-lLnGEZoM/lib/python3.6/site-packages/flake8/main/application.py", line 394, in run
        self._run(argv)
      File "/home/ubuntu/virtualenvs/d70c332e20daa20d-lLnGEZoM/lib/python3.6/site-packages/flake8/main/application.py", line 383, in _run
        self.report()
      File "/home/ubuntu/virtualenvs/d70c332e20daa20d-lLnGEZoM/lib/python3.6/site-packages/flake8/main/application.py", line 374, in report
        self.report_errors()
      File "/home/ubuntu/virtualenvs/d70c332e20daa20d-lLnGEZoM/lib/python3.6/site-packages/flake8/main/application.py", line 335, in report_errors
        results = self.file_checker_manager.report()
      File "/home/ubuntu/virtualenvs/d70c332e20daa20d-lLnGEZoM/lib/python3.6/site-packages/flake8/checker.py", line 267, in report
        results_reported += self._handle_results(filename, results)
      File "/home/ubuntu/virtualenvs/d70c332e20daa20d-lLnGEZoM/lib/python3.6/site-packages/flake8/checker.py", line 169, in _handle_results
        physical_line=physical_line,
      File "/home/ubuntu/virtualenvs/d70c332e20daa20d-lLnGEZoM/lib/python3.6/site-packages/flake8/style_guide.py", line 418, in handle_error
        code, filename, line_number, column_number, text, physical_line
      File "/home/ubuntu/virtualenvs/d70c332e20daa20d-lLnGEZoM/lib/python3.6/site-packages/flake8/style_guide.py", line 564, in handle_error
        self.formatter.handle(error)
      File "/home/ubuntu/virtualenvs/d70c332e20daa20d-lLnGEZoM/lib/python3.6/site-packages/flake8/formatting/base.py", line 86, in handle
        line = self.format(error)
      File "/home/ubuntu/virtualenvs/d70c332e20daa20d-lLnGEZoM/lib/python3.6/site-packages/teamcity/flake8_v3_plugin.py", line 43, in format
        line.rstrip(),
    AttributeError: 'NoneType' object has no attribute 'rstrip'