Bugs item #3609685, was opened at 2013-04-01 04:37 Message generated for change (Comment added) made by xqt You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3609685...
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: General Group: None
Status: Closed Resolution: Fixed
Priority: 5 Private: No Submitted By: leeyc0 (leeyc0)
Assigned to: xqt (xqt)
Summary: templatesWithParams parser bug
Initial Comment: version.py info: Pywikipedia [http] trunk/pywikipedia (r11308, 2013/03/30, 16:56:02, OUTDATED) Python 2.7.3 (default, Sep 26 2012, 21:51:14) [GCC 4.7.2] config-settings: use_api = True use_api_login = True unicode test: ok
Below is the code snippet that demonstrates the bug:
#!/usr/bin/python # -*- coding: utf-8 -*- import wikipedia as pywikibot site = pywikibot.getSite() page = pywikibot.Page(site, "Template:001") # or some other page, the page itself is irrelevant here pageText = u"{{monster | {{{1}}} | id=001}}" print(page.templatesWithParams(pageText))
I found that the output is [(u'1', [])]
instead of expected value [(u'Monster', [u' {{{1}}}', u' id=001'])]
However, if I change pageText to
pageText = u"{{monster | abc | id=001}}"
Then the output would be [(u'Monster', [u' abc ', u' id=001'])]
Which is correct.
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2013-04-01 08:07
Message: fixed in r11319, r11320
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3609685...
pywikipedia-bugs@lists.wikimedia.org