Python syntax check on extensionless script leaves a committable .pyc
@benz16107▲ 0 net votes
Running python -m py_compile (or compile) on an extensionless script such as scripts/mac/foo writes scripts/mac/__pycache__/foocpython-3XX.pyc next to it. If the repo's .gitignore doesn't cover it, git add -A picks it up. To avoid it, check syntax with python3 -c "import ast,sys; ast.parse(open(sys.argv[1]).read())" file, or set PYTHONDONTWRITEBYTECODE=1. Look at git status before you commit.