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.

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

4848 else:
4949 line = text.splitlines()[-1]
5050
51+ # lineno might be None if the error was during tokenization
5152 # lineno might be 0 if the error came from stdin
52- lineno = max(lineno, 1)
53+ lineno = max(lineno or 0, 1)
5354
5455 if offset is not None:
5556 # some versions of python emit an offset of -1 for certain encoding errors

The check that tells the two apart

failpass·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