Huji created this task. Huji added projects: Pywikibot, Continuous-Integration-Config. Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.
TASK DESCRIPTION This is resulting in CI tests to trip, complaining about code that is in unchanged files. Example: https://gerrit.wikimedia.org/r/c/pywikibot/core/+/990725/5 Relevant portions from the CI log <https://integration.wikimedia.org/ci/job/pywikibot-core-tox-docker/23958/console>: ... 22:59:58 flake8-py38 run-test: commands[2] | flake8 --color always --doctests 22:59:58 [276] /src$ /src/.tox/flake8-py38/bin/flake8 --color always --doctests 23:00:17 ./pywikibot/data/api/__init__.py: line 60:17: B038 editing a loop's mutable iterable often leads to unexpected results/bugs 23:00:17 ./pywikibot/proofreadpage.py: line 546:29: B038 editing a loop's mutable iterable often leads to unexpected results/bugs 23:00:17 ./scripts/dataextend.py: line 970:33: B038 editing a loop's mutable iterable often leads to unexpected results/bugs 23:00:17 ./scripts/dataextend.py: line 1096:45: B038 editing a loop's mutable iterable often leads to unexpected results/bugs 23:00:17 4 23:00:17 ERROR: InvocationError for command /src/.tox/flake8-py38/bin/flake8 --color always --doctests (exited with code 1) ... Example of piece of (notably, unchanged) code that tripped this: ./pywikibot/data/api/__init__.py ... if isinstance(family, SubdomainFamily): for cookie in http.cookie_jar: if family.domain == cookie.domain: http.cookie_jar.clear(cookie.domain, cookie.path, cookie.name) ... running `.clear()` on `http.cookie_jar` is what is triggering the test in this case. This seems to be related to the newly added functionality in flake8 (added yesterday <https://github.com/PyCQA/flake8-bugbear/commit/546d8332e236de89f4c6989257782ebc5a3dfd39>) which relates to checks for B038. Or it may be due to code from a few days ago (see issue #451 on flake8 GitHub <https://github.com/PyCQA/flake8-bugbear/issues/451>) which is "fixed" in yesterday's patch. I cannot verify which. The solution could be to update flake8 (if that fix for issue #451 indeeds fix this for us), or adding `nola` exceptions to the lines of code that are triggering B308 but are correct code. TASK DETAIL https://phabricator.wikimedia.org/T355372 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Huji Cc: Aklapper, Huji, pywikibot-bugs-list, mevo, PotsdamLamb, Jyoo1011, JohnsonLee01, SHEKH, Peteosx1x, Dijkstra, Khutuck, Mgagat, Totolinototo3, Zkhalido, Zanziii, Sadisticturd, Viztor, Wenyi, Tbscho, MayS, Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, Xqt, jayvdb, Masti, Alchimista, hashar
_______________________________________________ pywikibot-bugs mailing list -- [email protected] To unsubscribe send an email to [email protected]
