When there are more than 9 parameters in a template, templatesWithParam does not retuen them in the correct order. Below is a patch that fixes the problem:
### Eclipse Workspace Patch 1.0
#P pywikibot
Index: pywikibot/page.py
===================================================================
--- pywikibot/page.py (revision 8601)
+++ pywikibot/page.py (working copy)
@@ -930,13 +930,16 @@
args = template[1]
positional = []
named = {}
+ intkeys = {}
for key in sorted(args):
try:
int(key)
except ValueError:
named[key] = args[key]
else:
- positional.append(args[key])
+ intkeys[int(key)]=args[key]
+ for key in sorted(intkeys, key=int):
+ positional.append(intkeys[key])
for name in named:
positional.append("%s=%s" % (name, named[name]))
result.append((pywikibot.Page(link, self.site), positional))
Fixed in r8610