Strainu created this task.
Strainu added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.
TASK DESCRIPTION
Please treat this as an RFC rather than a bug report. The following
simplified code should illustrate the problem:
val = pywikibot.FilePage(commons, filename)
while val.isRedirectPage():
val = val.getRedirectTarget() //val is now a Page
claim = pywikibot.Claim(self.item.repo, prop, datatype="commonsMedia")
claim.setTarget(val) //this fails if filename is redirect, works otherwise
Even if theoretically you could have cross-ns redirects, these are highly
discouraged and so I believe it would make sense to override getRedirectTarget
in FilePage to ensure it returns a FilePage rather than a simple Page.
TASK DETAIL
https://phabricator.wikimedia.org/T233392
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Strainu
Cc: Aklapper, pywikibot-bugs-list, Strainu, Viztor, DannyS712, Wenyi, Tbscho,
MayS, Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, jayvdb,
Dalba, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs