Traceback (most recent call last): File "/var/lib/jenkins/stx-repo/master/.repo/repo/main.py", line 56, in <module> from subcmds.version import Version File "/var/lib/jenkins/stx-repo/master/.repo/repo/subcmds/__init__.py", line 38, in <module> ['%s' % name]) File "/var/lib/jenkins/stx-repo/master/.repo/repo/subcmds/upload.py", line 27, in <module> from hooks import RepoHook File "/var/lib/jenkins/stx-repo/master/.repo/repo/hooks.py", line 472 file=sys.stderr) ^ SyntaxError: invalid syntax
repo put out an update that has broken python 2 compatibility. To get it working again, you may need to install python3 on your system.
If you still encounter errors, It may be because repo uses ...
#!/usr/bin/env python
Which means that it will use the first 'python' it finds in your PATH,
and there
are various ways that 'python' might map to python2 or
python3
depending on your system. If your system is defaulting to
python2 and it otherwise is working for you, I'm reluctant to recommend
making python3 the default.
It might be safer to edit 'repo' and force it to use python3.
REPO=$(which repo)
PY3=$(which python3)
echo "
$REPO $PY3"
/usr/local/bin/repo /usr/bin/python3
# If
everything looks sane ...
sudo cp ${REPO} ${REPO}.original
sudo sed "s%#\!/usr/bin/env python%#\!${PY3}%" -i ${REPO}
# Did it
work ?
head -n1
$REPO
#!/usr/bin/python3
I'll be testing our build container, and
if required posting an update to our Dockerfile.