Steps to Reproduce:
In a Python shell in the Pywikibot root directory (i.e. $ python3), issue the following commands:
>>> from pywikibot import date >>> date.formats['MonthName']['hu']('január') >>> date.formats['MonthName']['hu']('május')
Close the shell, open it again, and try again. Repeat it a few times.
Actual Results:
- The first one (január) returns a random number [1..12] (stable within one shell run, but otherwise unpredictable).
- The second one raises ValueError: 'május' is not in list.
Expected Results:
- The first one consistently returns 1.
- The second one consistently returns 5.
Notes:
- Both bugs were introduced in 54f223acc1ec by @Xqt.
- First bug: site.mediawiki_messages() returns a dictionary, and it looks like list(dict) is not stable in Python.
- Second bug: it queries MediaWiki:may, but that’s the abbreviation (similar to MediaWiki:jan); it should use MediaWiki:may_long instead. Both the abbreviation and the full name are May in English, but in Hungarian the former is máj, while the latter is május.
(Yes, these are two separate bugs, but as they were introduced together, easier to reproduce together, and probably also faster to fix together, I decided to open one ticket for them. Feel free to make it two if you disagree.)