New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{{formatnum}} for numbers <10000 #24

Closed
putnik opened this Issue Dec 3, 2012 · 4 comments

Comments

Projects
None yet
2 participants
@putnik

putnik commented Dec 3, 2012

In Russian Wikipedia generating of PDF for page with {{formatnum:2000}} throws error.
Pages with {{formatnum:2 000}} (wrong input) or {{formatnum:20000}} generates without errors.

In Russian there is difference between format number lower and greater 10000: {{formatnum:2000}} → 2000, {{formatnum:20000}} → 20 000.

Error log:

RuntimeError: command failed with returncode 256: ['mw-render', '-w', 'rl', '-c', 'cache/1f/1fe54c6375ddf613/collection.zip', '-o', 'cache/1f/1fe54c6375ddf613/output.rl', '--status', 'qserve://localhost:14311/1fe54c6375ddf613:render-rl', '--template-blacklist', 'MediaWiki:PDF Template Blacklist', '--template-exclusion-category', u'\u0412\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u044f:\u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u043f\u0435\u0447\u0430\u0442\u0438', '--print-template-prefix', u'\u041f\u0435\u0447\u0430\u0442\u044c', '--print-template-pattern', u'$1/\u041f\u0435\u0447\u0430\u0442\u044c', '--language', 'ru']
Last Output:
    2012-12-03T02:44:49 mwlib.options.warn >> Both --print-template-pattern and --print-template-prefix (deprecated) specified. Using --print-template-pattern only.
    MISSING FONTS: 'Gujarati'
    1%  reading /tmp/tmp-mw-renderAp_clG/tmpsh4z6_/revisions-1.txt
    set locale to 'ru_RU' based on the language 'ru'
    1% laying out 0% error removing '/tmp/tmp-mw-renderAp_clG/tmpsh4z6_'
    Traceback (most recent call last):
      File "/home/pp/local/bin/mw-render", line 6, in <module>
        main()
      File "/home/pp/local/lib/python2.6/site-packages/mwlib/apps/render.py", line 241, in main
        return Main()()
      File "/home/pp/local/lib/python2.6/site-packages/mwlib/apps/render.py", line 206, in __call__
        writer(env, output=tmpout, status_callback=self.status, **writer_options)
      File "/home/pp/local/lib/python2.6/site-packages/mwlib/rl/rlwriter.py", line 2188, in writer
        r.writeBook(output=output, coverimage=coverimage, status_callback=status_callback)
      File "/home/pp/local/lib/python2.6/site-packages/mwlib/rl/rlwriter.py", line 469, in writeBook
        art = self.buildArticle(item)
      File "/home/pp/local/lib/python2.6/site-packages/mwlib/rl/rlwriter.py", line 358, in buildArticle
        revision=item.revision)
      File "/home/pp/local/lib/python2.6/site-packages/mwlib/nuwiki.py", line 421, in getParsedArticle
        return uparser.parseString(title=title, raw=raw, wikidb=self, lang=self.siteinfo["general"]["lang"])
      File "/home/pp/local/lib/python2.6/site-packages/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:6507)
      File "evaluate.py", line 285, in mwlib.templ.evaluate.Expander._expand (mwlib/templ/evaluate.c:6107)
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 1: ordinal not in range(128)
     in function system, file /home/pp/local/bin/nslave.py, line 64
@schmir

This comment has been minimized.

Contributor

schmir commented Dec 3, 2012

should be fixed in faa6b76

we still have to deploy that...

@schmir schmir closed this Dec 3, 2012

@schmir

This comment has been minimized.

Contributor

schmir commented Dec 3, 2012

it's deployed now, but since we don't choose a utf-8 based russian locale it's not quite working...

@schmir schmir reopened this Dec 3, 2012

@schmir

This comment has been minimized.

Contributor

schmir commented Dec 4, 2012

should be working now with mwlib 0.14.3, which is already deployed.

@schmir schmir closed this Dec 4, 2012

@putnik

This comment has been minimized.

putnik commented Dec 4, 2012

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment