sphinx-contrib / plantuml

BSD 2-Clause "Simplified" License
117 stars 44 forks source link

TypeError exception while trying to report another exception? #47

Closed 0x8000-0000 closed 4 years ago

0x8000-0000 commented 4 years ago

I'm getting the following traceback:

[ERROR] pdfbuilder.py:159 Failed to build doc
Traceback (most recent call last):
  File "/home/fiucha/.local/lib/python3.8/site-packages/rst2pdf/pdfbuilder.py", line 156, in write
    docwriter.write(doctree, destination)
  File "/home/fiucha/.local/lib/python3.8/site-packages/docutils/writers/__init__.py", line 78, in write
    self.translate()
  File "/home/fiucha/.local/lib/python3.8/site-packages/rst2pdf/pdfbuilder.py", line 587, in translate
    self.document.walkabout(visitor)
  File "/home/fiucha/.local/lib/python3.8/site-packages/docutils/nodes.py", line 214, in walkabout
    if child.walkabout(visitor):
  File "/home/fiucha/.local/lib/python3.8/site-packages/docutils/nodes.py", line 214, in walkabout
    if child.walkabout(visitor):
  File "/home/fiucha/.local/lib/python3.8/site-packages/docutils/nodes.py", line 214, in walkabout
    if child.walkabout(visitor):
  [Previous line repeated 4 more times]
  File "/home/fiucha/.local/lib/python3.8/site-packages/docutils/nodes.py", line 206, in walkabout
    visitor.dispatch_visit(self)
  File "/home/fiucha/.local/lib/python3.8/site-packages/docutils/nodes.py", line 1995, in dispatch_visit
    return method(node)
  File "/home/fiucha/.local/lib/python3.8/site-packages/sphinxcontrib/plantuml.py", line 495, in pdf_visit_plantuml
    refname, outfname = _convert_eps_to_pdf(self, refname, outfname)
  File "/home/fiucha/.local/lib/python3.8/site-packages/sphinxcontrib/plantuml.py", line 412, in _convert_eps_to_pdf
    raise PlantUmlError('error while running epstopdf\n\n' + serr)
TypeError: can only concatenate str (not "bytes") to str

I'm running "sphinxcontrib-plantuml (0.18)" on Ubuntu 20.04 using Python 3.8 .

0x8000-0000 commented 4 years ago

This seems to fix it:

@@ -409,7 +409,7 @@
                             % self.builder.config.plantuml_epstopdf)
     serr = p.communicate()[1]
     if p.returncode != 0:
-        raise PlantUmlError('error while running epstopdf\n\n' + serr)
+        raise PlantUmlError('error while running epstopdf\n\n' + serr.decode())
     return refname[:-4] + '.pdf', fname[:-4] + '.pdf'
yuja commented 4 years ago

Duplicate of #46