diff --git a/src/calibre/ebooks/epub/from_html.py b/src/calibre/ebooks/epub/from_html.py
index ae4be49ddb..3763d99cc4 100644
--- a/src/calibre/ebooks/epub/from_html.py
+++ b/src/calibre/ebooks/epub/from_html.py
@@ -39,7 +39,7 @@ from lxml import html
from PyQt4.Qt import QApplication, QPixmap
from calibre.ebooks.html import Processor, merge_metadata, get_filelist,\
- opf_traverse, create_metadata, rebase_toc, Link
+ opf_traverse, create_metadata, rebase_toc, Link, parser
from calibre.ebooks.epub import config as common_config, tostring
from calibre.ptempfile import TemporaryDirectory
from calibre.ebooks.metadata.toc import TOC
@@ -77,7 +77,7 @@ def check(opf_path, pretty_print):
for path in html_files:
base = os.path.dirname(path)
- root = html.fromstring(open(content(path), 'rb').read())
+ root = html.fromstring(open(content(path), 'rb').read(), parser=parser)
for element, attribute, link, pos in list(root.iterlinks()):
link = to_unicode(link)
plink = Link(link, base)
diff --git a/src/calibre/gui2/jobs2.py b/src/calibre/gui2/jobs2.py
index a0b7063c79..e5b17ef664 100644
--- a/src/calibre/gui2/jobs2.py
+++ b/src/calibre/gui2/jobs2.py
@@ -188,6 +188,6 @@ class DetailView(QDialog, Ui_Dialog):
def update(self):
- self.log.setPlainText(self.job.gui_text())
+ self.log.setPlainText(self.job.console_text())
vbar = self.log.verticalScrollBar()
vbar.setValue(vbar.maximum())
diff --git a/src/calibre/parallel.py b/src/calibre/parallel.py
index fbc9ba3d9b..0b543ea27f 100644
--- a/src/calibre/parallel.py
+++ b/src/calibre/parallel.py
@@ -567,23 +567,27 @@ class Job(object):
return 'ERROR'
def console_text(self):
- ans = [u'Error in job: ']
+ ans = [u'Job: ']
if self.description:
ans[0] += self.description
+ if self.exception is not None:
+ header = unicode(self.exception.__class__.__name__) if \
+ hasattr(self.exception, '__class__') else u'Error'
+ header = u'**%s**'%header
+ header += u': '
+ try:
+ header += unicode(self.exception)
+ except:
+ header += unicode(repr(self.exception))
+ ans.append(header)
+ if self.traceback:
+ ans.append(u'**Traceback**:')
+ ans.extend(self.traceback.split('\n'))
+
if self.log:
if isinstance(self.log, str):
self.log = unicode(self.log, 'utf-8', 'replace')
ans.append(self.log)
- header = unicode(self.exception.__class__.__name__) if \
- hasattr(self.exception, '__class__') else u'Error'
- header += u': '
- try:
- header += unicode(self.exception)
- except:
- header += unicode(repr(self.exception))
- ans.append(header)
- if self.traceback:
- ans.append(self.traceback)
return (u'\n'.join(ans)).encode('utf-8')
def gui_text(self):
@@ -611,7 +615,7 @@ class Job(object):
self.log = unicode(self.log, 'utf-8', 'replace')
ans.extend(self.log.split('\n'))
- return '\n'.join(ans)
+ return '
'.join(ans)
class ParallelJob(Job):
diff --git a/upload.py b/upload.py
index 583b32677c..4dc7d92d6b 100644
--- a/upload.py
+++ b/upload.py
@@ -213,7 +213,7 @@ def upload_src_tarball():
check_call('scp dist/calibre-*.tar.gz divok:%s/'%DOWNLOADS)
def stage_one():
- check_call('sudo rm -rf build', shell=True)
+ check_call('sudo rm -rf build src/calibre/plugins/*', shell=True)
os.mkdir('build')
shutil.rmtree('docs')
os.mkdir('docs')