mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1388 (Creation of the default cover in a recipe crashes)
This commit is contained in:
parent
35c5c1fac6
commit
80dcfebe4b
@ -17,7 +17,8 @@ from PyQt4.Qt import QApplication, QFile, Qt, QPalette, QSize, QImage, QPainter,
|
||||
from PyQt4.QtWebKit import QWebPage
|
||||
|
||||
|
||||
from calibre import browser, __appname__, iswindows, LoggingInterface, strftime, __version__
|
||||
from calibre import browser, __appname__, iswindows, LoggingInterface, \
|
||||
strftime, __version__, preferred_encoding
|
||||
from calibre.ebooks.BeautifulSoup import BeautifulSoup, NavigableString, CData, Tag
|
||||
from calibre.ebooks.metadata.opf import OPFCreator
|
||||
from calibre.ebooks.lrf import entity_to_unicode
|
||||
@ -817,8 +818,9 @@ class BasicNewsRecipe(object, LoggingInterface):
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
'''%dict(title=self.title, author=self.__author__,
|
||||
date=time.strftime(self.timefmt),
|
||||
'''%dict(title=self.title if isinstance(self.title, unicode) else self.title.decode(preferred_encoding, 'replace'),
|
||||
author=self.__author__ if isinstance(self.__author__, unicode) else self.__author__.decode(preferred_encoding, 'replace'),
|
||||
date=strftime(self.timefmt),
|
||||
app=__appname__ +' '+__version__,
|
||||
img=img)
|
||||
f2 = tempfile.NamedTemporaryFile(suffix='cover.html')
|
||||
|
Loading…
x
Reference in New Issue
Block a user