| Xqt added a comment. |
Now it raises HiddenKeyError when construction the log entry
=================================== FAILURES =================================== _________________________ TestLogEvents.test_logevents _________________________
self = <tests.site_tests.TestLogEvents testMethod=test_logevents>
def test_logevents(self):
"""Test logevents method."""
mysite = self.get_site()
le = list(mysite.logevents(total=10))
self.assertLessEqual(len(le), 10)
self.assertTrue(all(isinstance(entry, pywikibot.logentries.LogEntry)
for entry in le))
for typ in ("block", "protect", "rights", "delete", "upload",
"move", "import", "patrol", "merge"):
> for entry in mysite.logevents(logtype=typ, total=3):
tests/site_tests.py:1239:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pywikibot/data/api.py:2817: in __iter__
result = self.result(item)
pywikibot/data/api.py:3033: in result
return self.entryFactory.create(pagedata)
pywikibot/logentries.py:471: in create
return self._creator(logdata)
pywikibot/logentries.py:454: in <lambda>
self._creator = lambda data: logclass(data, self._site)
pywikibot/logentries.py:194: in __init__
pos = self.data['title'].find('#')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = {u'comment': u'{{uw-uhblock}} <!-- Username violation, hard block -->', u'logi...-04-19T13:45:56Z', u'actionhidden': u'', u'userhidden': u'', u'type': u'block'}
key = 'title'
def __missing__(self, key):
"""Debug when the key is missing."""
pywikibot.debug(u"API log entry received:\n" + repr(self),
_logger)
if ((key in ('ns', 'title', 'pageid', 'logpage', 'params', 'action')
and 'actionhidden' in self)
or (key == 'comment' and 'commenthidden' in self)
or (key == 'user' and 'userhidden' in self)):
raise HiddenKeyError(
"Log entry ({0}) has a hidden '{1}' key and you don't have "
> 'permission to view it.'.format(self._type, key))
E HiddenKeyError: Log entry (block) has a hidden 'title' key and you don't have permission to view it.
pywikibot/logentries.py:43: HiddenKeyErrorTASK DETAIL
EMAIL PREFERENCES
To: Xqt
Cc: Dalba, Masti, Magul, Shanmugamp7, gerritbot, Xqt, jayvdb, Aklapper, pywikibot-bugs-list, XZise, Versusxo, Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, Baloch007, Darkminds3113, Lordiis, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, Tbscho, MayS, Lewizho99, Mdupont, JJMC89, Maathavan, Avicennasis, Alchimista, Rxy
Cc: Dalba, Masti, Magul, Shanmugamp7, gerritbot, Xqt, jayvdb, Aklapper, pywikibot-bugs-list, XZise, Versusxo, Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, Baloch007, Darkminds3113, Lordiis, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, Tbscho, MayS, Lewizho99, Mdupont, JJMC89, Maathavan, Avicennasis, Alchimista, Rxy
_______________________________________________ pywikibot-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs
