jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] PatrolEntry: Allow cur/prev id to be str ......................................................................
[FIX] PatrolEntry: Allow cur/prev id to be str
Sometimes PatrolEntry returns str instead of int for the revision ids. See also bug T101603.
Change-Id: I8febb1b23bb54bba0dcef11e4e887583b5c238ba --- M pywikibot/logentries.py 1 file changed, 7 insertions(+), 5 deletions(-)
Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/logentries.py b/pywikibot/logentries.py index 238f0b2..40dfb14 100644 --- a/pywikibot/logentries.py +++ b/pywikibot/logentries.py @@ -298,15 +298,17 @@ def current_id(self): """Return the current id.""" # key has been changed in mw 1.19; try the new mw style first - return (self._params['curid'] - if 'curid' in self._params else self._params['cur']) + # sometimes it returns strs sometimes ints + return int(self._params['curid'] + if 'curid' in self._params else self._params['cur'])
@property def previous_id(self): - # key has been changed in mw 1.19; try the new mw style first """Return the previous id.""" - return (self._params['previd'] - if 'previd' in self._params else self._params['prev']) + # key has been changed in mw 1.19; try the new mw style first + # sometimes it returns strs sometimes ints + return int(self._params['previd'] + if 'previd' in self._params else self._params['prev'])
@property def auto(self):
pywikibot-commits@lists.wikimedia.org