PDF Output: Ignore unparseable links instead of aborting the conversion on them. Fixes #1429282 [HTML to PDF crashes with ebook-convert (Invalid IPv6 URL)](https://bugs.launchpad.net/calibre/+bug/1429282)

This commit is contained in:
Kovid Goyal 2015-03-07 07:59:16 +05:30
parent 3a284d0860
commit fc2fab8a53

View File

@ -78,7 +78,11 @@ class Links(object):
pass
else:
url = href + (('#'+frag) if frag else '')
try:
purl = urlparse(url)
except Exception:
self.pdf.debug('Ignoring unparseable URL: %r' % url)
continue
if purl.scheme and purl.scheme != 'file':
action = Dictionary({
'Type':Name('Action'), 'S':Name('URI'),