Also a problem with other double border characters, works okay replacing it with some ASCII thing like "a".
No problem if removing the .strip(), or running Black which removes the wrapping parentheses:
assert """
╝""".strip()
commands ran
$ ❯ flake8 t.py
Found existing alias for "flake8". You should use: "f8"
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.12/bin/flake8", line 8, in <module>
sys.exit(main())
^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/flake8/main/cli.py", line 23, in main
app.run(argv)
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/flake8/main/application.py", line 198, in run
self._run(argv)
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/flake8/main/application.py", line 187, in _run
self.run_checks()
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/flake8/main/application.py", line 103, in run_checks
self.file_checker_manager.run()
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/flake8/checker.py", line 238, in run
self.run_serial()
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/flake8/checker.py", line 221, in run_serial
).run_checks()
^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/flake8/checker.py", line 527, in run_checks
self.process_tokens()
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/flake8/checker.py", line 512, in process_tokens
self.handle_newline(token_type)
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/flake8/checker.py", line 542, in handle_newline
self.run_logical_checks()
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/flake8/checker.py", line 439, in run_logical_checks
comments, logical_line, mapping = self.processor.build_logical_line()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/flake8/processor.py", line 231, in build_logical_line
comments, logical, mapping_list = self.build_logical_line_tokens()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/flake8/processor.py", line 212, in build_logical_line_tokens
previous_text = self.lines[row_index][column_index]
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
IndexError: string index out of range
how did you install flake8?
unmodified output of
flake8 --bug-report
describe the problem
what I expected to happen
No
IndexError
, flake8 to report any style issues found.sample code
Minimal reproducer from this full test case: https://github.com/jazzband/prettytable/blob/f044b0e2c99680c975e5d4523771f819934f4611/tests/test_prettytable.py#L1205-L1222
Also a problem with other double border characters, works okay replacing it with some ASCII thing like "a".
No problem if removing the
.strip()
, or running Black which removes the wrapping parentheses:commands ran