Univention Bugzilla – Bug 55598
B023 Function definition does not bind loop variable
Last modified: 2023-02-22 11:12:15 CET
flake8-bugbear detected multiple issues in our code: base/univention-config-registry/python/univention/service_info.py:197:18: B023 Function definition does not bind loop variable `link` base/univention-config-registry/python/univention/service_info.py:198:11: B023 Function definition does not bind loop variable `commandline` base/univention-config-registry/python/univention/service_info.py:198:50: B023 Function definition does not bind loop variable `commandline` base/univention-config-registry/python/univention/service_info.py:198:79: B023 Function definition does not bind loop variable `commandline` base/univention-system-setup/umc/python/setup/__init__.py:459:38: B023 Function definition does not bind loop variable `maxlenth` base/univention-system-setup/umc/python/setup/__init__.py:463:40: B023 Function definition does not bind loop variable `table` management/univention-directory-manager-modules/modules/univention/admin/syntax.py:862:18: B023 Function definition does not bind loop variable `module` management/univention-directory-manager-modules/modules/univention/admin/syntax.py:863:24: B023 Function definition does not bind loop variable `module` management/univention-directory-manager-modules/modules/univention/admin/syntax.py:863:45: B023 Function definition does not bind loop variable `filter_s` management/univention-directory-manager-modules/modules/univention/admin/syntax.py:871:14: B023 Function definition does not bind loop variable `module` management/univention-directory-manager-modules/modules/univention/admin/syntax.py:871:38: B023 Function definition does not bind loop variable `filter_s` management/univention-directory-manager-modules/scripts/convert-user-base64-photos:63:29: B023 Function definition does not bind loop variable `idn` services/univention-net-installer/univention-net-installer-daemon:127:4: B023 Function definition does not bind loop variable `client` services/univention-net-installer/univention-net-installer-daemon:129:12: B023 Function definition does not bind loop variable `client` services/univention-net-installer/univention-net-installer-daemon:133:5: B023 Function definition does not bind loop variable `client` B023: Functions defined inside a loop must not use variables redefined in the loop, because late-binding closures are a classic gotcha: https://docs.python-guide.org/writing/gotchas/#late-binding-closures
Some functions did not bound the loop variables over the function signature. This was changed. univention-system-setup (13.0.5-1) 0c190f91d80e | Bug #55598: Function now binds the loop variables 7318b3588239 | Bug #55598: Function now binds the loop variables univention-net-installer (13.0.3-1) 0c190f91d80e | Bug #55598: Function now binds the loop variables univention-directory-manager-modules (15.0.15-1) 0c190f91d80e | Bug #55598: Function now binds the loop variables d4c540a574af | Bug #55598: Function now binds the loop variables univention-config-registry (15.0.9-1) 694580dacc38 | Bug #55598: Function now binds the loop variables
OK: code changes OK: changelog entry
UCS 5.0-3 has been released. https://docs.software-univention.de/release-notes/5.0-3/en/ If this error occurs again, please clone this bug.