One function
Reporter in PyCQA/pyflakes
The author described this change as “fix error reporter and testsuite in 3.11.4+ (#775)”. It counts as a record because the check below fails on the code as it stood at f2671ffe1 and passes on 836631f2f, with nothing else changed between the two runs.
ProjectPyCQA/pyflakes
Fix saved2023-06-13
Sharing licenceMIT · LICENSE
Change size+2 −1
What the code was meant to do, written into the code itself as a docstring
Formats the results of pyflakes checks to users.
The change
| 48 | 48 | else: | |
| 49 | 49 | line = text.splitlines()[-1] | |
| 50 | 50 | ||
| 51 | + | # lineno might be None if the error was during tokenization | |
| 51 | 52 | # lineno might be 0 if the error came from stdin | |
| 52 | - | lineno = max(lineno, 1) | |
| 53 | + | lineno = max(lineno or 0, 1) | |
| 53 | 54 | ||
| 54 | 55 | if offset is not None: | |
| 55 | 56 | # some versions of python emit an offset of -1 for certain encoding errors |
The check that tells the two apart
fail→pass·pyflakes/test/test_api.py::CheckTests::test_misencodedFileUTF16
Check file pyflakes/test/test_api.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before itf2671ffe1785754f0e73d148635cbb38e673e169
Broken version dated2023-04-25
Modulepyflakes.reporter
Units changedReporter
Fingerprintba86bc3fc0217138
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in PyCQA/pyflakes
- 2019-01-23ExportBinding
- 2016-05-12Fix TypeError when processing relative imports (#61)
- 2015-11-12Fix global removing all UndefinedName