calibre PDF conversion helper program crashes, leaving output file empty

Bug #672137 reported by Delan Azabani
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
calibre (Ubuntu)
Fix Released
Undecided
os

Bug Description

Binary package hint: calibre

Converting ebooks to PDF fails in calibre. The python script crashes with

Traceback (most recent call last):
  File "/usr/lib/calibre/calibre/ebooks/pdf/writer.py", line 177, in _render_html
    self._render_book()
  File "/usr/lib/calibre/calibre/ebooks/pdf/writer.py", line 145, in _render_book
    self._write()
  File "/usr/lib/calibre/calibre/ebooks/pdf/writer.py", line 206, in _write
    outPDF = PdfFileWriter(title=self.metadata.title, author=self.metadata.author)
TypeError: __init__() got an unexpected keyword argument 'title'

and the resulting output PDF file is empty.

Revision history for this message
Tom G. (santacruztomm) wrote :

This is due to the pyPdf toolkit being updated.

calibre/ebooks/pdf/writer.py calls PdfFileWriter with a title and author, but that is not an attribute the PdfFileWriter function takes.

Just comment out that line, and make it:
outPDF = PdfFileWriter()

Don't forget to keep the same indentation, as python will not forgive.

Nuisance yes, but easy fix :)

Hope that helps,
Tom Golubev

Revision history for this message
Tom G. (santacruztomm) wrote :

Above is the fix

Revision history for this message
Delan Azabani (azabani) wrote :

Thanks for the fix you've suggested.

Revision history for this message
Delan Azabani (azabani) wrote :

Thanks again; I've tried it and it works perfectly.

Revision history for this message
Claude Cesa (claude-cesa) wrote :

Hello, i have similar problem with ubuntu 11.04 and calibre 0.7.44 converting odt to pdf

Traceback (most recent call last):
  File "/usr/lib/calibre/calibre/gui2/__init__.py", line 241, in dispatch
    self.func(*args, **kwargs)
  File "/usr/lib/calibre/calibre/gui2/actions/convert.py", line 170, in book_converted
    raise Exception(_('Empty output file, '
Exception: Fichier de sortie vide, le processus de conversion a probablement cessé de fonctionné

Thank you a lot if you could help me.
Claude.

Revision history for this message
Fabrice Coutadeur (fabricesp) wrote :

Hi Claude,

Given the traceback you attached, this seems to be another problem: please open a new bug report for it.

Thanks,
Fabrice

Revision history for this message
Fabrice Coutadeur (fabricesp) wrote :

Fixed in Oneiric with 0.8.2+dfsg-1ubuntu1

Changed in calibre (Ubuntu):
status: New → Fix Released
os (syriatalks)
Changed in calibre (Ubuntu):
assignee: nobody → os (syriatalks)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.