From 4dd934ce17d0839f869910893dd859df17bdf3ed Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Fri, 17 Jul 2026 15:51:10 +0000 Subject: [PATCH 1/2] Handle none gracefully --- dev/archery/archery/crossbow/core.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev/archery/archery/crossbow/core.py b/dev/archery/archery/crossbow/core.py index 0a9d1bd5d326..a4fe261e31f0 100644 --- a/dev/archery/archery/crossbow/core.py +++ b/dev/archery/archery/crossbow/core.py @@ -452,6 +452,8 @@ def _github_login(self, github_token=None): if not _have_github: raise ImportError('Must install PyGithub') github_token = github_token or self.github_token + if github_token is None: + return Github(timeout=30) return Github(auth=GithubAuth.Token(github_token), timeout=30) def as_github_repo(self, github_token=None): From 6f3e744b73e8164d08c873d92a104228b91664bb Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Sat, 18 Jul 2026 11:15:23 -0400 Subject: [PATCH 2/2] handle all falsy values --- dev/archery/archery/crossbow/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/archery/archery/crossbow/core.py b/dev/archery/archery/crossbow/core.py index a4fe261e31f0..e88a08445cdf 100644 --- a/dev/archery/archery/crossbow/core.py +++ b/dev/archery/archery/crossbow/core.py @@ -448,11 +448,11 @@ def file_contents(self, commit_id, file): return blob.data def _github_login(self, github_token=None): - """Returns a logged in Github instance using PyGithub""" + """Returns a Github instance, optionally authenticated with a token""" if not _have_github: raise ImportError('Must install PyGithub') github_token = github_token or self.github_token - if github_token is None: + if not github_token: return Github(timeout=30) return Github(auth=GithubAuth.Token(github_token), timeout=30)