##[group]Checking out the ref
[command]/usr/bin/git checkout --progress --force refs/remotes/pull/3584/head
Note: switching to 'refs/remotes/pull/3584/head'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at 996e624 bisect: blow away the whole python modules to see if codeql still complains [skip tests]
##[endgroup]
Setup
Observed behavior
CodeQL reports parse errors about two Python files. Here's a log sample (I've replaced my actual filenames with
foo.pyandbar.py):What I tried
I ran
python -m py_compileon both files. This check completed without errors on Python 3.7, 3.8, 3.9, 3.10, 3.11, and 3.12.I removed an old header from the files:
# -*- coding: future_fstrings -*-. This header was a leftover from a Python 2 to Python 3 migration involving https://github.com/asottile-archive/future-fstrings. The warnings stayed. (I imagine, but am not sure, that this header caused the original parsing problem. These two files were the only ones in the repo that still had it.)I checked the files for invisible characters and for a byte order mark. The only non-ASCII characters were some bullet characters inside one docstring. I replaced them with ASCII hyphens. The warnings stayed.
I replaced the full contents of both files with a single
passstatement. The warnings stayed.I deleted both files. The warnings stayed. I believe these logs confirm that CodeQL scanned the commit where I deleted the files (commit 996e624 in pull request 3584):
Expected behavior
python -m py_compileaccepts.