node:pywikipedia kudu$ python replace.py -transcludes:sometemplate -regex 'someregex' 'somereplacement' unicode test: triggers problem #3081100 Getting references to [[Template:sometemplate]] via API... Getting 1 pages from wiki:wiki... Traceback (most recent call last): File "replace.py", line 825, in <module> main() File "replace.py", line 816, in main bot.run() File "replace.py", line 399, in run new_text = self.doReplacements(new_text) File "replace.py", line 342, in doReplacements allowoverlap=self.allowoverlap) File "~/pywikipedia/pywikibot/textlib.py", line 175, in replaceExcept match.group(groupID) + \ TypeError: coercing to Unicode: need string or buffer, NoneType found
~K
Please ignore.
On Fri, Sep 9, 2011 at 12:42 PM, Kudu kududot@gmail.com wrote:
node:pywikipedia kudu$ python replace.py -transcludes:sometemplate -regex 'someregex' 'somereplacement' unicode test: triggers problem #3081100 Getting references to [[Template:sometemplate]] via API... Getting 1 pages from wiki:wiki... Traceback (most recent call last): File "replace.py", line 825, in <module> main() File "replace.py", line 816, in main bot.run() File "replace.py", line 399, in run new_text = self.doReplacements(new_text) File "replace.py", line 342, in doReplacements allowoverlap=self.allowoverlap) File "~/pywikipedia/pywikibot/textlib.py", line 175, in replaceExcept match.group(groupID) + \ TypeError: coercing to Unicode: need string or buffer, NoneType found
~K
Command line is not Python, try to use double quotes. And it would be useful to write your original regex. This seemes to be a malformed command rather than a replace.py error.
2011/9/9 Kudu kududot@gmail.com
node:pywikipedia kudu$ python replace.py -transcludes:sometemplate -regex 'someregex' 'somereplacement'
pywikipedia-l@lists.wikimedia.org