Python files that are imported as modules or always executed using the interpreter explicitely (python test.py) should not have a shebang and should not be executable.
Fix the current inconsistencies.
This is mostly a scripted diff, except for the PythonShebangLinter.php changes:
find test/functional/ -name '*py' -not -name 'test_runner.py' | xargs sed -i '1{/^#!/d;}'
find test/functional/ -name '*py' -not -name 'test_runner.py' | xargs chmod 644
find electrum -name '*py' -not -path 'electrum/scripts/*' -not -path 'electrum/contrib/*' -not -name 'test_runner.py' | xargs sed -i '1{/^#!/d;}'
find electrum -name '*py' -not -path 'electrum/scripts/*' -not -path 'electrum/contrib/*' -not -name 'test_runner.py' | xargs chmod 644
find chronik/chronik-plugin-impl -name '*py' | xargs sed -i '1{/^#!/d;}'
chmod 755 contrib/testgen/base58.py
sed -i '1{/^#!/d;}' contrib/buildbot/shieldio.py
sed -i '1{/^#!/d;}' contrib/buildbot/test/abcbot_fixture.py
sed -i '1{/^#!/d;}' electrum/scripts/util.pyAnd arc lint to remove a few blank lines at the beginning of files.
Note that the sed command removes the first line of a file if it starts with #! (shebang lines).
Depends on D15449