Skip to content

Commit

Permalink
[fix] check whether tile exists first
Browse files Browse the repository at this point in the history
This is a temporary solution for T372106.
FilePage.exists() gives True if the file decription exists even there
is no file at all but file_is_shared() fails with missing imageinfo
exception. We should have a way to check for existing image.

For this special case such files should be delinked.

Bug: T372106
Change-Id: Ieec85c7de50ba65433f2d9731aaf65316fb74c55
  • Loading branch information
xqt committed Aug 9, 2024
1 parent 0316411 commit c23b572
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/delinker.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def init_page(self, item) -> pywikibot.page.FilePage:
def skip_page(self, page) -> bool:
"""Skip pages which neither exists locally nor on shared repository."""
pywikibot.info('.', newline=False)
if page.file_is_shared() or page.exists():
if page.exists() or page.file_is_shared():
return True
return super().skip_page(page)

Expand Down

0 comments on commit c23b572

Please sign in to comment.