modification pagetemplate.py for bug with collection for mediawiki

correctif for the compatibility with collection of mediawiki 

bug trace: https://groups.google.com/forum/#!topic/mwlib/Q60Y6QqVcxI