Error: NameErrorfree variable 'default_branch' referenced before assignment in enclosing scope.
Bug Report
Summary and Bug Description
When trying any axii command, an error occurs
Error: NameErrorfree variable 'default_branch' referenced before assignment in enclosing scope.
After some debugging, seems like the error lies in the method repo_status
from armarx_setup/core/git.py
and is called by print_logo
at armarx_setup/cli/common.py
at line 346
axii_repo_status = repo_status(PACKAGE_ROOT, fetch=False)
A possible fix would be to add a
default_branch = None
inside the See comment below for a better fix.repo_status
method (which I will do in the MR !742 (closed) ) though I am not sure if this is a suitable fix because I don't fully understand the code I am trying to fix, other possible values I could think of might be main
or stable
Current Behavior
No axii command working because of this error
Expected Behavior
Axii commands working
Steps to Reproduce
I don't know what steps to give to reproduce this as this only seems to happen to my local axii installation on my machine with ubuntu 22 (though at the axii installation of a coworker who uses ubuntu 22 aswell no such error occurs)
here is what I do to get the error
- run
axii
- get error
Diagnosis
Given the error with the report command that I fixed in issue 740, I pasted the output I get in that branch. (though it should be identical)
Output of axii self report
axii self report
┏━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Scope ┃ Info ┃
┡━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ Axii │ Axii 24.01.1.0 @fix/axii-self-report--1 with shell integration │
│ OS │ Ubuntu 22.04.3 LTS │
│ Kernel │ Linux 6.5.0-15-generic #15~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri │
│ │ Jan 12 18:54:30 UTC 2 x86_64 GNU/Linux │
│ Shell │ /bin/zsh │
│ Python │ Python 3.10.12 │
│ Pip │ anybadge==1.14.0, application_properties==0.8.2, astroid==3.0.3, │
│ │ certifi==2024.2.2, charset-normalizer==2.0.12, click==8.0.0, │
│ │ Columnar==1.4.1, commonmark==0.9.1, coverage==7.4.1, │
│ │ cycler==0.12.1, dbus-python==1.2.18, decorator==5.1.1, dill==0.3.8, │
│ │ distro==1.7.0, exceptiongroup==1.2.0, gitdb==4.0.11, │
│ │ GitPython==3.1.18, idna==3.6, igraph==0.9.11, │
│ │ importlib-metadata==7.0.1, iniconfig==2.0.0, isort==5.13.2, │
│ │ Jinja2==3.1.3, json-source-map==1.0.5, kiwisolver==1.4.5, │
│ │ MarkupSafe==2.1.5, matplotlib==3.3.0, mccabe==0.7.0, networkx==2.5, │
│ │ notify2==0.3.1, numpy==1.23.0, packaging==23.2, pillow==10.2.0, │
│ │ platformdirs==4.2.0, pluggy==1.4.0, psutil==5.9.4, │
│ │ Pygments==2.17.2, pygraphviz==1.6, pylint==3.0.3, │
│ │ pylint-gitlab==2.0.0, pylint-pytest==1.1.7, pymarkdownlnt==0.9.17, │
│ │ pyparsing==3.1.1, PyQt5==5.15.0, PyQt5-sip==12.13.0, pytest==8.0.0, │
│ │ pytest-cov==4.1.0, python-dateutil==2.8.2, python-gitlab==4.4.0, │
│ │ python-igraph==0.9.11, python-Levenshtein==0.12.2, PyYAML==6.0.1, │
│ │ requests==2.26.0, requests-toolbelt==1.0.0, rich==12.6.0, │
│ │ rich-click==1.2.1, six==1.16.0, smmap==5.0.1, texttable==1.7.0, │
│ │ thefuzz==0.19.0, tomli==2.0.1, tomlkit==0.12.3, toolz==0.12.1, │
│ │ typing_extensions==4.9.0, urllib3==1.26.18, wcwidth==0.2.13, │
│ │ wrapt==1.16.0, xdg==5.1.1, zipp==3.17.0 │
└────────┴─────────────────────────────────────────────────────────────────────┘