Last modified: 2013-12-19 03:36:52 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T56868, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 54868 - isDisambig results in AttributeError
isDisambig results in AttributeError
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
core-(2.0)
All All
: Unprioritized major
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-02 09:27 UTC by Wieland Hoffmann
Modified: 2013-12-19 03:36 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Wieland Hoffmann 2013-10-02 09:27:28 UTC
In [1]: import pywikibot
In [2]: s = pywikibot.Site("et", "wikipedia")
In [3]: p = pywikibot.Page(s, "Hannes Varblane")
In [4]: p.isDisambig()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-af3848c4be35> in <module>()
----> 1 p.isDisambig()

/home/wieland/dev/pywikibot-core/pywikibot/page.pyc in isDisambig(self, get_Index)
    569         if self.site.hasExtension('Disambiguator', False):
    570             # If the Disambiguator extension is loaded, use it
--> 571             return 'disambiguation' in self.properties()
    572 
    573         if not hasattr(self.site, "_disambigtemplates"):

/home/wieland/dev/pywikibot-core/pywikibot/page.pyc in properties(self, force)
    379         if not hasattr(self, '_pageprops') or force:
    380             self.site.loadpageprops(self)
--> 381         return self._pageprops
    382 
    383     def defaultsort(self, force=False):

AttributeError: 'Page' object has no attribute '_pageprops'

ยป git describe --always --dirty 
a987c8e-dirty

(Dirty here refers to the submodules having been updated)

This is obviously using the core branch.
Comment 1 Gerrit Notification Bot 2013-10-02 11:34:12 UTC
Change 87060 had a related patch set uploaded by FelixReimann:
Set _pageprops to {} per default before updating from live site as - a page without any pageprops has no corresponding entry in the pagedict and, thus, Page._pageprops will not be set in api.update_page() - the pageprops may be removed after a forced upda

https://gerrit.wikimedia.org/r/87060
Comment 2 Merlijn van Deen (test) 2013-11-21 20:57:29 UTC
Keeping this open so someone can work on a better solution than the current one.
Comment 3 Gerrit Notification Bot 2013-11-21 21:08:47 UTC
Change 87060 merged by jenkins-bot:
Bug 54868 - isDisambig results in AttributeError

https://gerrit.wikimedia.org/r/87060
Comment 4 Gerrit Notification Bot 2013-11-22 05:12:11 UTC
Change 96951 had a related patch set uploaded by Legoktm:
Return an empty array if there are no page properties

https://gerrit.wikimedia.org/r/96951
Comment 5 Kunal Mehta (Legoktm) 2013-11-22 05:13:13 UTC
(In reply to comment #2)
> Keeping this open so someone can work on a better solution than the current
> one.

Fixing MediaWiki sounds like a better solution to me :)
Comment 6 Gerrit Notification Bot 2013-12-19 03:36:52 UTC
Change 96951 abandoned by Legoktm:
Return an empty array if there are no page properties

https://gerrit.wikimedia.org/r/96951

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links