Binįris, I am not sure what you mean by “embedded templates”, in case of pages from Commons creator namespace they are technically all templates and take template parameters. I suspect not many people in other wikis  were applying bots to process templates and that is why not many people run into this issue.

 

In my case I know now what is causing the problem and can strip page text from app the parameters like “{{{1|}}}” before applying Page.templatesWithParams function . In my case it is easy since, text in creator namespace follows very specific pattern and there is not much variation. However this might be a serious issue for others.

 

Jarek T.

(user:Jarekt)

 

From: pywikipedia-l-bounces@lists.wikimedia.org [mailto:pywikipedia-l-bounces@lists.wikimedia.org] On Behalf Of Binįris
Sent: Monday, October 24, 2011 2:59 PM
To: Pywikipedia discussion list
Subject: Re: [Pywikipedia-l] Problems with Page.templatesWithParams function

 

There is an old and serious problem with embedded templates that has not been fixed. Please have a look at this:

http://sourceforge.net/tracker/index.php?func=detail&aid=3158761&group_id=93107&atid=603138

Here I wrote a solution that worked for me in the given case, but it was not applied to Pywiki beacuse somebody showed an example where it causes another problem. It is not easy at all to catch embedded templates with regular expresses. Try my solution, but this is just an idea and not sure to work for you. You may want to adjust the regex to your needs (but don't forget you have changed it!).

--
Binįris