Fix Python UnicodeDecodeError with os.listdir - Fix Git Remote Origin Already Exists Error-Git Detached HEAD: How to Fix and Prevent

Result check
- Keep one change per test run so you know which step helped.
- Undo temporary changes after the issue is confirmed.