jenkins-bot has submitted this change and it was merged.
Change subject: Bugfix for older mediawiki short monthsnames ......................................................................
Bugfix for older mediawiki short monthsnames
- older short months names sometimes didn't ends with a abbreviating dot. This causes the TimeStripper to fail with with "incorrect month name in page", TypeError: an integer is required This path also registers undotted short months names to be compared. - start enumerate() with start=1
Change-Id: I25f467620b79fd39fba20e45aaeb0386b50101e4 --- M pywikibot/textlib.py 1 file changed, 5 insertions(+), 3 deletions(-)
Approvals: John Vandenberg: Looks good to me, but someone else must approve Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py index 70839ac..43dc65b 100644 --- a/pywikibot/textlib.py +++ b/pywikibot/textlib.py @@ -1173,9 +1173,11 @@ self.site = site
self.origNames2monthNum = {} - for n, (_long, _short) in enumerate(self.site.months_names): - self.origNames2monthNum[_long] = n + 1 - self.origNames2monthNum[_short] = n + 1 + for n, (_long, _short) in enumerate(self.site.months_names, start=1): + self.origNames2monthNum[_long] = n + self.origNames2monthNum[_short] = n + if _short.endswith('.'): + self.origNames2monthNum[_short[:-1]] = n
self.groups = [u'year', u'month', u'hour', u'time', u'day', u'minute', u'tzinfo']
pywikibot-commits@lists.wikimedia.org