Last modified: 2013-10-15 20:10:55 UTC
Created attachment 13438 [details] Proposed patch I'm running https://code.google.com/p/wikiro/source/browse/trunk/robots/python/pywikipedia/diacritice/diacritics_redirects.py on ro.wp. The put function throws a KeyError: >>> Comuna Adâncata, Ialomița <<< [[Comuna Adâncata, Ialomiţa]] doesn't exist Do you want to create a redirect? ([y]es, [N]o, [a]ll, [q]uit) y {} Traceback (most recent call last): File "pwb.py", line 58, in <module> execfile(sys.argv[0]) File "diacritice/diacritics_redirects.py", line 127, in <module> main() File "diacritice/diacritics_redirects.py", line 123, in main bot.run() File "diacritice/diacritics_redirects.py", line 50, in run self.treat(page) File "diacritice/diacritics_redirects.py", line 99, in treat page_mod.put(u"#%s [[%s]]" % (self.site.redirect(True), page_t.title()), comment) File "/home/andrei/pywikibot-core/pywikibot/page.py", line 872, in put async=async, callback=callback, **kwargs) File "/home/andrei/pywikibot-core/pywikibot/page.py", line 795, in save **kwargs) File "/home/andrei/pywikibot-core/pywikibot/page.py", line 804, in _save watch=watchval, bot=botflag, **kwargs) File "/home/andrei/pywikibot-core/pywikibot/site.py", line 709, in callee return fn(self, *args, **kwargs) File "/home/andrei/pywikibot-core/pywikibot/site.py", line 2636, in editpage params["basetimestamp"] = page._revisions[lastrev].timestamp KeyError: 4164884 The error is caused by the _revisions dict not being populated. Possible patch is attached.
This is on core branch
I'm curious if the Pywikibot maintainers would appreciate patches in Gerrit...
Change 87915 had a related patch set uploaded by Merlijn van Deen: Populate the revision dict if lastrev is not in it. https://gerrit.wikimedia.org/r/87915
Change 87915 merged by Xqt: Populate the revision dict if lastrev is not in it. https://gerrit.wikimedia.org/r/87915