https://bugzilla.wikimedia.org/show_bug.cgi?id=71104
Bug ID: 71104 Summary: page.isRedirectPage() reports always False after page.isDisambig() Product: Pywikibot Version: core (2.0) Hardware: All OS: All Status: NEW Severity: normal Priority: Unprioritized Component: General Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: CommodoreFabianus@gmx.de Web browser: --- Mobile Platform: ---
When calling page.isDisambig() a page.isRedirectPage() followed after that is reporting it always false. Calling 'page.text' does 'fix' that so that it returns the actual value.
import pywikibot enwp = pywikibot.Site('en', 'wikipedia') page = pywikibot.Page(enwp, 'TBBT') page.isRedirectPage()
True
page = pywikibot.Page(enwp, 'TBBT') not page.isDisambig()
True
page.isRedirectPage()
False
page.text
'#REDIRECT [[The Big Bang Theory]]'
page.isRedirectPage()
True
https://bugzilla.wikimedia.org/show_bug.cgi?id=71104
Fabian CommodoreFabianus@gmx.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Priority|Unprioritized |High
--- Comment #1 from Fabian CommodoreFabianus@gmx.de --- Okay the reason is the following: Page.isDisambig() calls site.loadpageprops() which loads them and calls data.api.update_page() and this isn't differentiating between prop=pageprops and prop=info, and 'pageprops' is no redirect info.
I'd like to know if there is a reason when to use prop=pageprops? It looks to me all the data is also in prop=info.
Another fix would be, to only update those properties which have been received, because the property is not present if it's False so it needs to know if that property is not present because it's False or because it wasn't requested.
https://bugzilla.wikimedia.org/show_bug.cgi?id=71104
--- Comment #2 from Gerrit Notification Bot gerritadmin@wikimedia.org --- Change 162157 had a related patch set uploaded by XZise: [FIX] API: Don't set 'redirect' value if it couldn't be returned
https://gerrit.wikimedia.org/r/162157
https://bugzilla.wikimedia.org/show_bug.cgi?id=71104
Gerrit Notification Bot gerritadmin@wikimedia.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |PATCH_TO_REVIEW
https://bugzilla.wikimedia.org/show_bug.cgi?id=71104
--- Comment #3 from Fabian CommodoreFabianus@gmx.de --- Okay 'prop=pageprops' doesn't work how I thought it worked. And because there are other cases in which update_page was called, I made a more general fix: 'update_page' now receives the property with which the pagedict was obtained. If any value in the result is only present for a specific property and a missing value could indicate that it's False or not requested, this does allow an easy check to determine between both possibilites.
https://bugzilla.wikimedia.org/show_bug.cgi?id=71104
--- Comment #4 from Gerrit Notification Bot gerritadmin@wikimedia.org --- Change 162157 merged by jenkins-bot: [FIX] API: Don't set 'redirect' value if it couldn't be returned
https://gerrit.wikimedia.org/r/162157
https://bugzilla.wikimedia.org/show_bug.cgi?id=71104
John Mark Vandenberg jayvdb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|PATCH_TO_REVIEW |RESOLVED CC| |jayvdb@gmail.com Resolution|--- |FIXED
pywikipedia-bugs@lists.wikimedia.org