Vvjjkkii renamed this task from "page is a redirect but not a redirect" to "ybdaaaaaaa".
Vvjjkkii reopened this task as "Open".
Vvjjkkii removed Xqt as the assignee of this task.
Vvjjkkii removed subscribers: gerritbot, Aklapper.
Vvjjkkii added projects: CheckUser, Connected-Open-Heritage-Batch-uploads (RAΓ„-KMB_1_2017-02), Tamil-Sites, Gamepress, Hashtags, JADE, KartoEditor, Language-2018-Apr-June, New-Editor-Experiences, Mail, TCB-Team.
Vvjjkkii updated the task description. (Show Details)

CHANGES TO TASK DESCRIPTION
When attempting to get the redirects to a page using `page.backlinks(filterRedirects=True)`, `IsNotRedirectPage` is raised. The page the exception claims is not a redirect, however, is a redirect.

`page.getReferences(redirectsOnly=True)` gives the same exception.

`page.getReferences(follow_redirects=False, redirectsOnly=True)` yields the same page twice.

```lang=python
Python 3.4.3 (default, Nov 28 2017, 16:41:13)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pywikibot
>>> site = pywikibot.Site('en', 'wikipedia')
>>> page = pywikibot.Page(site, 'File:1979–80 National Football League (Ireland) final.jpg')
>>> page.backlinks(filterRedirects=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/shared/pywikipedia/core/pywikibot/tools/__init__.py", line 1423, in wrapper
return obj(*__args, **__kw)
File "/shared/pywikipedia/core/pywikibot/page.py", line 1062, in backlinks
content=content
File "/shared/pywikipedia/core/pywikibot/site.py", line 3649, in pagebacklinks
if redir.getRedirectTarget() == page:
File "/shared/pywikipedia/core/pywikibot/page.py", line 1664, in getRedirectTarget
return self.site.getredirtarget(self)
File "/shared/pywikipedia/core/pywikibot/site.py", line 3166, in getredirtarget
raise IsNotRedirectPage(page)
pywikibot.exceptions.IsNotRedirectPage: Page [[en:File:1979-80 National Football League (Ireland) final.jpg]] is not a redirect page.
>>>
>>> page2 = pywikibot.Page(site, 'File:1979-80 National Football League (Ireland) final.jpg')
>>> page2.isRedirectPage()
True
>>> page2.getRedirectTarget()
Page('File:1979–80 National Football League (Ireland) final.jpg')
>>> page3 = page2.getRedirectTarget()
>>> page3
Page('File:1979–80 National Football League (Ireland) final.jpg')
>>> page == page3
True
>>>
>>> page.getReferences(redirectsOnly=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/shared/pywikipedia/core/pywikibot/tools/__init__.py", line 1423, in wrapper
return obj(*__args, **__kw)
File "/shared/pywikipedia/core/pywikibot/page.py", line 1038, in getReferences
content=content
File "/shared/pywikipedia/core/pywikibot/tools/__init__.py", line 1423, in wrapper
return obj(*__args, **__kw)
File "/shared/pywikipedia/core/pywikibot/site.py", line 3718, in pagereferences
namespaces=namespaces, content=content),
File "/shared/pywikipedia/core/pywikibot/site.py", line 3649, in pagebacklinks
if redir.getRedirectTarget() == page:
File "/shared/pywikipedia/core/pywikibot/page.py", line 1664, in getRedirectTarget
return self.site.getredirtarget(self)
File "/shared/pywikipedia/core/pywikibot/site.py", line 3166, in getredirtarget
raise IsNotRedirectPage(page)
pywikibot.exceptions.IsNotRedirectPage: Page [[en:File:1979-80 National Football League (Ireland) final.jpg]] is not a redirect page.
>>>
>>> list(page.getReferences(follow_redirects=False, redirectsOnly=True))
[FilePage('File:1979-80 National Football League (Ireland) final.jpg'), FilePage('File:1979-80 National Football League (Ireland) final.jpg')]
```
Note: The difference between [[https://en.wikipedia.org/wiki/File:1979%E2%80%9380_National_Football_League_(Ireland)_final.jpg|page]] and [[https://en.wikipedia.org/w/index.php?title=File:1979-80_National_Football_League_(Ireland)_final.jpg&redirect=no|page2]] is en dash vs hyphen.
26570726f6475636520796f757220627567207573696e67206120726563656e742076657273696f6e206f662074686520736f6674776172652c20746f2068652077696b6920636f6e74656e74206c616e67756167652e0a0a5468616e6b20796f752e0a546167730a436865636b557365720ad70a436f6e6e65637465642d4f70656e2d48657269746167652d42617463682d75706c6f61647320285241c42d4b4d425f315f323031372d3032290ad70a54616d696c2d53697465730ad70a47616d6570726573730ad70a48617368746167730ad70a4a4144450ad70a4b6172746f456469746f720ad70a4c616e67756167652d323031382d4170722d4a756e650ad70a4e65772d456469746f722d457870657269656e6365730ad70a4d61696c0ad70a5443422d5465616d0ad70a53756273637269626572730a4465736372697074696f6e20507265766965770a436f6e74656e77a6f6e652073657474696e6720696e20796f75722070726f66696c652c20636c69636b20746f207265636f6e63696c652e

TASK DETAIL
https://phabricator.wikimedia.org/T194233

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Vvjjkkii
Cc: Framawiki, zhuyifei1999, Anomie, Dvorapa, Xqt, pywikibot-bugs-list, JJMC89, AndyTan, Gaboe420, Zylc, Versusxo, Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, 1978Gage2001, Baloch007, Darkminds3113, Bsandipan, Lordiis, herron, pan199312, Adik2382, Chicocvenancio, alanajjar, Th3d3v1ls, Ramalepe, Liugev6, Magul, Tbscho, MayS, Lea_WMDE, Mattias_Ostmar-WMSE, Sethakill, Lewizho99, Mdupont, Maathavan, dg711, Jseddon, Ryuch, Mkdw, RuyP, Avicennasis, JEumerus, Trizek-WMF, KasiaWMDE, 0x010C, srodlund, Luke081515, grin, Bsadowski1, mys_721tx, Snowolf, Huji, Gryllida, jayvdb, Dalba, Tobi_WMDE_SW, Masti, revi, scfc, Alchimista, He7d3r, Romaine, Mbch331, Rxy, Jay8g, Glaisher, Krenair, Legoktm, chasemp, gerritbot, Aklapper
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to