From 83ef000e4812c6eefafb30903c52495f58c1c970 Mon Sep 17 00:00:00 2001 From: Duncan Ogilvie Date: Tue, 14 Jul 2026 00:35:18 +0200 Subject: [PATCH] Fix exception when DMCA'd/empty gists were backed up --- github_backup/github_backup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/github_backup/github_backup.py b/github_backup/github_backup.py index 49470c4..14a6f54 100644 --- a/github_backup/github_backup.py +++ b/github_backup/github_backup.py @@ -2109,7 +2109,10 @@ def backup_repositories(args, output_directory, repositories): ) if repository.get("is_gist"): - # dump gist information to a file as well + # dump gist information to a file as well; the clone may have + # been skipped (e.g. DMCA-blocked or empty gist), so make sure + # the directory exists + mkdir_p(repo_cwd) output_file = "{0}/gist.json".format(repo_cwd) with codecs.open(output_file, "w", encoding="utf-8") as f: json_dump(repository, f)