Xqt created this task.
Herald added subscribers: pywikibot-bugs-list, Zppix, Aklapper.
TASK DESCRIPTION
logentries.LogEntryFactory creates invalid LogEntry type instead of raising
an error:
>>> import pwb, pywikibot as py
>>> from pywikibot.logentries import LogEntry
>>> site = py.Site()
>>> lef = LogEntryFactory(site)
>>> data = {'type': 'foo'}
>>> x = lef._createFromData(data)
>>> type(x)
<class 'pywikibot.logentries.LogEntry'>
>>> x.type()
'foo'
>>> x._expectedType is None
True
>>>
There is an exception handling inside _createFromData() method but the
KeyError will never raised because _getEntryClass takes it and always returns a
generic LogEntry object.
TASK DETAIL
https://phabricator.wikimedia.org/T135505
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Xqt
Cc: Ricordisamoa, russblau, Aklapper, Ladsgroup, Zppix, Xqt,
pywikibot-bugs-list, Mdupont, jayvdb
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs