Last modified: 2014-09-26 05:39:58 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T49575, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47575 - Generating PDFs for books with more than one page fails horribly at pl.wikisource
Generating PDFs for books with more than one page fails horribly at pl.wikiso...
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
Collection (Other open bugs)
All All
: High major (vote)
: ---
Assigned To: Nobody - You can work on this!
: 52108 (view as bug list)
Depends on: 47867
  Show dependency treegraph
Reported: 2013-04-23 21:37 UTC by Bartosz Dziewoński
Modified: 2014-09-26 05:39 UTC (History)
8 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Bartosz Dziewoński 2013-04-23 21:37:41 UTC
Generating PDFs for books with more than one page fails horribly at pl.wikisource. Example book: - click "Pobierz PDF" and watch the havoc unfold.

RuntimeError: command failed with returncode 256: ['mw-render', '-w', 'rl', '-c', 'cache/87/87f4f0452d9a266c/', '-o', 'cache/87/87f4f0452d9a266c/output.rl', '--status', 'qserve://localhost:14311/87f4f0452d9a266c:render-rl', '--template-blacklist', 'MediaWiki:PDF Template Blacklist', '--template-exclusion-category', u'Omi\u0144 w druku', '--print-template-prefix', 'Drukuj', '--print-template-pattern', '$1/Wydruk', '--language', 'pl']
Last Output:
    2013-04-23T21:30:16 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-renderkA0Rg1/tmp_GQQMz/revisions-1.txt
    set locale to 'pl_PL.UTF-8' based on the language 'pl'
    1% laying out 0% error removing '/tmp/tmp-mw-renderkA0Rg1/tmp_GQQMz'
    Traceback (most recent call last):
      File "/home/pp/local/bin/mw-render", line 9, in <module>
        load_entry_point('mwlib==0.15.7', 'console_scripts', 'mw-render')()
      File "/home/pp/local/lib/python2.6/site-packages/mwlib/apps/", line 241, in main
        return Main()()
      File "/home/pp/local/lib/python2.6/site-packages/mwlib/apps/", 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/", line 2193, in writer
        r.writeBook(output=output, coverimage=coverimage, status_callback=status_callback)
      File "/home/pp/local/lib/python2.6/site-packages/mwlib/rl/", line 471, in writeBook
        art = self.buildArticle(item)
      File "/home/pp/local/lib/python2.6/site-packages/mwlib/rl/", line 360, in buildArticle
      File "/home/pp/local/lib/python2.6/site-packages/mwlib/", line 430, in getParsedArticle
        return uparser.parseString(title=title, raw=raw, wikidb=self, lang=self.siteinfo["general"]["lang"], expandTemplates=expandTemplates)
      File "/home/pp/local/lib/python2.6/site-packages/mwlib/refine/", line 62, in parseString
        a = compat.parse_txt(input, title=title, wikidb=wikidb, nshandler=nshandler, lang=lang, magicwords=magicwords, uniquifier=uniquifier, expander=te)
      File "/home/pp/local/lib/python2.6/site-packages/mwlib/refine/", line 193, in parse_txt
        sub = core.parse_txt(raw, **kwargs)
      File "/home/pp/local/lib/python2.6/site-packages/mwlib/refine/", line 1037, in parse_txt
        combined_parser(parsers)(tokens, xopts)
      File "/home/pp/local/lib/python2.6/site-packages/mwlib/refine/", line 646, in __call__
        p(x, xopts)
      File "/home/pp/local/lib/python2.6/site-packages/mwlib/refine/", line 762, in __init__
        tokens[i] = m(name, vlist, inner or u"", xopts)
      File "/home/pp/local/lib/python2.6/site-packages/mwlib/refine/", line 879, in create_pages
        pages =, e)
    AttributeError: 'DictDB' object has no attribute 'select'
     in function system, file /home/pp/local/lib/python2.6/site-packages/mwlib/, line 64
Comment 1 Sam Reed (reedy) 2013-04-29 15:36:26 UTC
This is server side so lies with PediaPress to fix it
Comment 2 Andre Klapper 2013-04-29 15:44:25 UTC
> This is server side so lies with PediaPress to fix it

CC'ing Volker - Volker, if there are better people to CC please tell me. :)

General comments:

When I use "Pobierz jako PDF" in the left pane, I get through to the download section for your link:
"Dokument został wygenerowany. Pobierz plik na swój komputer."
The PDF is a bit too empty for my taste, but that's likely another bug that I have in mind and cannot find right now.

"Pobierz jako PDF" links to:

If I use "Pobierz PDF" from
  [ Przygotuj książkę ] [ Pobierz PDF ] [ Pobierz EPUB ] [ Pomoc ]
I can reproduce the problem.

"Pobierz PDF" links to:

Out of curiosity, here does <table class="plainlinks"> come from?I've tried Wikisources in other languages but don't get it displayed there.

Are there other examples for this?
Comment 3 Ralf Schmitt 2013-04-30 09:17:06 UTC
Thank you for the bug report.

It looks like this has been broken with our recent switch to expand
templates via api.php. This change was necessary in order to support
the scribunto extension.

Unfortunately we have two problems here:

1. The "AttributeError: 'DictDB' object has no attribute 'select'"
error is caused by our software using a stripped down 'DictDB'
instance as a "wiki database". We would be able to fix that.

2. Since we now expand templates when fetching articles, we do *not*
fetch the templates being used by an article. Since api.php does not
expand the <pages> tag, the information for expanding the pages tag is
not even available.

My suggestion for fixing this issue would be to fix the expand
templates functionality, but that is not possible according to

The other way the issue could be fixed, would be to work with
mediawiki's HTML output. But that's a lot of work, which we can't
afford to do in order to fix wikisource.
Comment 4 Ralf Schmitt 2013-04-30 11:11:19 UTC
I've opened a bug about using mediawiki's HTML output:
Comment 5 Ralf Schmitt 2013-08-21 11:47:57 UTC
*** Bug 52108 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.