Skip to content

prevent KeyError when wiki file does not exist in download fallback#128

Merged
LukasGold merged 2 commits into
mainfrom
fix-file-download-keyerror
Jul 7, 2026
Merged

prevent KeyError when wiki file does not exist in download fallback#128
LukasGold merged 2 commits into
mainfrom
fix-file-download-keyerror

Conversation

@LukasGold

Copy link
Copy Markdown
Contributor

When the MediaWiki FileApi returns download-notfound, the exception raised
inside the try block was silently caught by the broad except Exception,
setting web_api_failed=True. The subsequent fallback then crashed with
KeyError: 'url' because the file's imageinfo has no URL for non-existent
files. Fix by using a flag instead of raising inside the try block.

LukasGold added 2 commits July 7, 2026 10:42
When the MediaWiki FileApi returns download-notfound, the exception raised
inside the try block was silently caught by the broad `except Exception`,
setting web_api_failed=True. The subsequent fallback then crashed with
KeyError: 'url' because the file's imageinfo has no URL for non-existent
files. Fix by using a flag instead of raising inside the try block.
Adds */accounts.pwd.yaml to prevent credential files from being staged,
and removes the duplicate */osw_files/* entry that was auto-appended.
@LukasGold LukasGold requested a review from simontaurus July 7, 2026 08:44
@LukasGold LukasGold self-assigned this Jul 7, 2026
@LukasGold LukasGold added the bug Something isn't working label Jul 7, 2026
@LukasGold LukasGold merged commit c639282 into main Jul 7, 2026
1 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant