pediapress / mwlib

mediawiki parser library
103 stars 35 forks source link

TypeError when expanding NAMESPACE #3

Closed schmir closed 12 years ago

schmir commented 12 years ago
[py27]  ~/ % mw-render -c :zh -o test.pdf -w rl '维基百科'
MISSING FONTS: 'AR PL UMing HK','Nazli','UnBatang','Arundina Serif','Lohit Telugu','Sarai','Lohit Punjabi','Lohit Oriya','AnjaliOldLipi','Kedage','LikhanNormal','Lohit Tamil','Khmer'
creating nuwiki in '/tmp/tmps_8Rgt/nuwiki'
removing tmpdir '/tmp/tmps_8Rgt'
memory used: res=33.7 virt=164.3
reading /tmp/tmpILSK0Q/revisions-1.txt
removing '/tmp/tmpILSK0Q'
Traceback (most recent call last):
  File "/home/ralf/local/bin/mw-render", line 9, in <module>
    load_entry_point('mwlib==0.13.1', 'console_scripts', 'mw-render')()
  File "/home/ralf/code/mwlib/apps/render.py", line 211, in main
    return Main()()
  File "/home/ralf/code/mwlib/apps/render.py", line 176, in __call__
    writer(env, output=tmpout, status_callback=self.status, **writer_options)
  File "/home/ralf/rl/mwlib/rl/rlwriter.py", line 2179, in writer
    r.writeBook(output=output, coverimage=coverimage, status_callback=status_callback)
  File "/home/ralf/rl/mwlib/rl/rlwriter.py", line 467, in writeBook
    art = self.buildArticle(item)
  File "/home/ralf/rl/mwlib/rl/rlwriter.py", line 356, in buildArticle
    revision=item.revision)
  File "/home/ralf/code/mwlib/nuwiki.py", line 422, in getParsedArticle
    return uparser.parseString(title=title, raw=raw, wikidb=self, lang=self.siteinfo["general"]["lang"])
  File "/home/ralf/code/mwlib/refine/uparser.py", line 34, in parseString
    input = te.expandTemplates(True)
  File "evaluate.py", line 295, in mwlib.templ.evaluate.Expander.expandTemplates (mwlib/templ/evaluate.c:5930)
  File "evaluate.py", line 282, in mwlib.templ.evaluate.Expander._expand (mwlib/templ/evaluate.c:5567)
  File "evaluate.py", line 28, in mwlib.templ.evaluate.flatten (mwlib/templ/evaluate.c:1103)
  File "evaluate.py", line 30, in mwlib.templ.evaluate.flatten (mwlib/templ/evaluate.c:1134)
  File "nodes.py", line 210, in mwlib.templ.nodes.Template.flatten (mwlib/templ/nodes.c:4619)
  File "nodes.py", line 291, in mwlib.templ.nodes.Template._flatten (mwlib/templ/nodes.c:5976)
  File "evaluate.py", line 28, in mwlib.templ.evaluate.flatten (mwlib/templ/evaluate.c:1103)
  File "evaluate.py", line 30, in mwlib.templ.evaluate.flatten (mwlib/templ/evaluate.c:1134)
  File "nodes.py", line 210, in mwlib.templ.nodes.Template.flatten (mwlib/templ/nodes.c:4619)
  File "nodes.py", line 277, in mwlib.templ.nodes.Template._flatten (mwlib/templ/nodes.c:5777)
  File "/home/ralf/code/mwlib/templ/magics.py", line 563, in __call__
    res = m(args) or ''  # FIXME: catch TypeErros
  File "/home/ralf/code/mwlib/templ/magics.py", line 209, in wrapper
    return f(self, pagename)
  File "/home/ralf/code/mwlib/templ/magics.py", line 254, in NAMESPACE
    ns, partial, full = self.nshandler.splitname(pagename)
  File "/home/ralf/code/mwlib/nshandling.py", line 128, in splitname
    title = unicode(title, 'utf-8')
TypeError: coercing to Unicode: need string or buffer, tuple found