From cf7f46cbc846b593d282606595766a9d2571d5ab Mon Sep 17 00:00:00 2001 From: xrayFailed <36075211+Ixve@users.noreply.github.com> Date: Tue, 16 Sep 2025 01:05:16 +0200 Subject: [PATCH] Odd bug fix For whatever reason - a single character name made the entire script throw a KeyError, and it was fixed by just moving the unicode_patch outside the if-statement concurrent.futures.process._RemoteTraceback: """ Traceback (most recent call last): File "C:\Program Files\Python311\Lib\concurrent\futures\process.py", line 261, in _process_worker r = call_item.fn(*call_item.args, **call_item.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python311\Lib\site-packages\gitfive\lib\xray.py", line 83, in get_repo results["usernames_history"][username]["names"][name]["repos"].add(repo_id) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^ KeyError: 'R' """ --- gitfive/lib/xray.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitfive/lib/xray.py b/gitfive/lib/xray.py index 659d954..deb855b 100644 --- a/gitfive/lib/xray.py +++ b/gitfive/lib/xray.py @@ -74,8 +74,8 @@ def get_repo(token: str, target_username: str, target_id: int, repos_folder: Pat # if username.lower() != target_username.lower(): # => https://github.com/mxrch/GitFive/issues/16 if not username in results["usernames_history"]: results["usernames_history"][username] = {"names": {}} + name = unicode_patch(entity.name) if not entity.name in results["usernames_history"][username]["names"]: - name = unicode_patch(entity.name) results["usernames_history"][username]["names"][name] = {"repos": set()} results["usernames_history"][username]["names"][name]["repos"].add(repo_id) @@ -359,4 +359,4 @@ async def analyze_ext_contribs(runner: GitfiveRunner): if not name in runner.target.usernames_history[username]["names"]: runner.target._add_name(name) # Previous names are valid informations (unless target spoof it) runner.target.usernames_history[username]["names"][name] = {"repos": set()} - runner.target.usernames_history[username]["names"][name]["repos"].add(repo_name) \ No newline at end of file + runner.target.usernames_history[username]["names"][name]["repos"].add(repo_name)