flake8 black format errors in Python 3.12

Flake8 is a Python code style checker that can detect unexecuted syntax errors. Python 3.12 with flake8 detects PEP8 formatting errors inside f-strings that are not yet handled by Black. Currently these formatting errors must be corrected by hand.

CI jobs should test with Python < 3.12 and Python >= 3.12 to ensure the f-string syntax is valid in older and newer Python versions.