From 9d027747d1efd165eec80ad3de7e3f4e9f5159dd Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Fri, 20 Dec 2019 08:03:46 +0100 Subject: [PATCH] [Backup] Fix generation of `repos.json` file in backup process (#3114) * fix: generation of `repos.json` file in backup process * chore(changelog): add towncrier entry --- changelog.d/3114.bugfix.rst | 1 + redbot/core/utils/__init__.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/3114.bugfix.rst diff --git a/changelog.d/3114.bugfix.rst b/changelog.d/3114.bugfix.rst new file mode 100644 index 000000000..d1e6e1ffc --- /dev/null +++ b/changelog.d/3114.bugfix.rst @@ -0,0 +1 @@ +Fix generation of `repos.json` file in backup process. \ No newline at end of file diff --git a/redbot/core/utils/__init__.py b/redbot/core/utils/__init__.py index 9fcf37bcc..cb21c4355 100644 --- a/redbot/core/utils/__init__.py +++ b/redbot/core/utils/__init__.py @@ -428,7 +428,7 @@ async def create_backup(dest: Path = Path.home()) -> Optional[Path]: repo_mgr = RepoManager() await repo_mgr.initialize() repo_output = [] - for _, repo in repo_mgr._repos: + for repo in repo_mgr.repos: repo_output.append({"url": repo.url, "name": repo.name, "branch": repo.branch}) repos_file = data_path / "cogs" / "RepoManager" / "repos.json" with repos_file.open("w") as fs: