sphinx + rst2pdf error: unexpected keyword argument 'ts'
See original GitHub issueError while trying to generate the pdf with rst2pdf
Problem
I was using sphinx and rst2pdf without any problems but the issue occured today upon a fresh installation on another PC. I’m no longer able to generate the documentation in pdf format. The only difference between my configuration and the new one is the sphinx version: I have v1.7.4 while the new pc has v.1.7.6 (installed by default with pip install command).
Procedure to reproduce the problem
sphinx-build -b pdf source build/pdf
Error logs / results
writing MyDocsTryOut... [ERROR] pdfbuilder.py:130 __init__() got an unexpected keyword argument 'ts'
Traceback (most recent call last):
File "c:\python27\lib\site-packages\rst2pdf\pdfbuilder.py", line 127, in write
docwriter.write(doctree, destination)
File "c:\python27\lib\site-packages\docutils\writers\__init__.py", line 80, in write
self.translate()
File "c:\python27\lib\site-packages\rst2pdf\pdfbuilder.py", line 621, in translate
compressed=self.compressed)
File "c:\python27\lib\site-packages\rst2pdf\createpdf.py", line 653, in createPdf
pdfdoc.multiBuild(elements)
File "c:\python27\lib\site-packages\reportlab\platypus\doctemplate.py", line 1135, in multiBuild
self.canv.save()
File "c:\python27\lib\site-packages\reportlab\pdfgen\canvas.py", line 1240, in save
self._doc.SaveToFile(self._filename, self)
File "c:\python27\lib\site-packages\reportlab\pdfbase\pdfdoc.py", line 215, in SaveToFile
data = self.GetPDFData(canvas)
File "c:\python27\lib\site-packages\reportlab\pdfbase\pdfdoc.py", line 241, in GetPDFData
return self.format()
File "c:\python27\lib\site-packages\reportlab\pdfbase\pdfdoc.py", line 418, in format
IOf = IO.format(self)
File "c:\python27\lib\site-packages\reportlab\pdfbase\pdfdoc.py", line 866, in format
fcontent = format(self.content, document, toplevel=1) # yes this is at top level
File "c:\python27\lib\site-packages\reportlab\pdfbase\pdfdoc.py", line 80, in format
f = element.format(document)
File "c:\python27\lib\site-packages\reportlab\pdfbase\pdfdoc.py", line 1546, in format
D['ModDate'] = D["CreationDate"] = PDFDate(ts=document._timeStamp,dateFormatter=self._dateFormatter)
TypeError: __init__() got an unexpected keyword argument 'ts'
Environment info
- OS: Windows 10
- Python version: 2.7.15
- Sphinx version: 1.7.6
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
python sphinx error: make_toctree() got an unexpected ...
make_toctree() got an unexpected keyword argument 'titles_only'. As far as I can tell, this error isn't reported/described online (yet).
Read more >Sphinx Documentation - Release 1.5.5 Georg Brandl
This is the documentation for the Sphinx documentation builder. Sphinx is a tool that translates a set of reStructuredText3 source files ...
Read more >Full text of "Sphinx Python Documentation Generator
Sphinx comes with a script called sphinx-quickstart that sets up a source directory and creates a de- fault conf . py with the...
Read more >rst2pdf - PyPI
Syntax highlighter for many languages, using Pygments. Supports embedding almost any kind of raster or vector images. Supports hyphenation. Sphinx integration.
Read more >Release 1.6.7 Georg Brandl - DocsLib
Sphinx Documentation Release 1.6.7 Georg Brandl Feb 04, 2018 Contents 1 ... 5 https://github.com/rst2pdf/rst2pdf 6 http://epydoc.sourceforge.net/ 7 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @Tok3nizer, I have found a workaround solution. Remove the
ts=
in line 1546 inpdfdoc.py
. The path to the file is printed in the last line of the trace. rst2pdf should be patched to handle the keyword arguments used by reportlab. Unfortunately I’m not knowledgeable enough myself to do so.I have solved this issue, refer this link https://github.com/rst2pdf/rst2pdf/commit/14668d34523e21faf21ba6bca20e623aa3c33de6.