Reputation: 3685
I am making use of the rst2pdf library to generate a PDF document via Sphinx. However when I attempt to do this I end up with the below error:
[exec] sphinx-build -b pdf -d stage/doctrees source/welcome stage/pdf
[exec] Running Sphinx v1.8.5
[exec] ['support/style']
[exec] loading pickled environment... done
[exec] building [mo]: targets for 0 po files that are out of date
[exec] building [pdf]: targets for 4 source files that are out of date
[exec] updating environment: 0 added, 0 changed, 0 removed
[exec] looking for now-outdated files... none found
[exec] processing WelcomeToRealtimeDespatch...
[exec] index
[exec] 01-introduction
[exec] 03-market
[exec] 05-administration
[exec] resolving references...
[exec] done
[exec] writing WelcomeToRealtimeDespatch...
[exec] FAILED
[exec] build succeeded.
[exec]
[exec] Build finished. The PDF files are in stage/pdf.
[exec] /usr/local/lib/python2.7/dist-packages/rst2pdf/pdfbuilder.py:207: RemovedInSphinx20Warning: env.create_index() is deprecated. Use sphinx.environment.adapters.indexentreis.IndexEntries instead.
[exec] genindex = self.env.create_index(self)
[exec] [ERROR] pdfbuilder.py:133 /home/catherine/workspace/rtd2/documentation/source/welcome/../../support/style/apicover.tmpl
[exec] Traceback (most recent call last):
[exec] File "/usr/local/lib/python2.7/dist-packages/rst2pdf/pdfbuilder.py", line 130, in write
[exec] docwriter.write(doctree, destination)
[exec] File "/usr/local/lib/python2.7/dist-packages/docutils/writers/__init__.py", line 80, in write
[exec] self.translate()
[exec] File "/usr/local/lib/python2.7/dist-packages/rst2pdf/pdfbuilder.py", line 600, in translate
[exec] date=date
[exec] File "/usr/local/lib/python2.7/dist-packages/rst2pdf/createpdf.py", line 112, in renderTemplate
[exec] template =jinja_env.get_template(tname)
[exec] File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 830, in get_template
[exec] return self._load_template(name, self.make_globals(globals))
[exec] File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 804, in _load_template
[exec] template = self.loader.load(self, name, globals)
[exec] File "/usr/local/lib/python2.7/dist-packages/jinja2/loaders.py", line 113, in load
[exec] source, filename, uptodate = self.get_source(environment, name)
[exec] File "/usr/local/lib/python2.7/dist-packages/jinja2/loaders.py", line 168, in get_source
[exec] pieces = split_template_path(template)
[exec] File "/usr/local/lib/python2.7/dist-packages/jinja2/loaders.py", line 31, in split_template_path
[exec] raise TemplateNotFound(template)
[exec] TemplateNotFound: /home/catherine/workspace/rtd2/documentation/source/welcome/../../support/style/apicover.tmpl
I can confirm that the template is at the path:
ls -l /home/catherine/workspace/rtd2/documentation/source/welcome/../../support/style/apicover.tmpl
-rwxrwxrwx 1 catherine catherine 436 Feb 14 2018 /home/catherine/workspace/rtd2/documentation/source/welcome/../../support/style/apicover.tmpl
Any ideas why pdfbuilder might not be able to find the supplied template?
Upvotes: 1
Views: 393
Reputation: 73
It looks like rst2pdf now forbids ".." in template path, try to normalize the path before, or use an older version of rst2pdf and query the devs about the retionale behind this.
Upvotes: 1