diff --git a/src/calibre/ebooks/pdf/render/links.py b/src/calibre/ebooks/pdf/render/links.py index 42eec636a0..902dd74b4a 100644 --- a/src/calibre/ebooks/pdf/render/links.py +++ b/src/calibre/ebooks/pdf/render/links.py @@ -78,7 +78,11 @@ class Links(object): pass else: url = href + (('#'+frag) if frag else '') - purl = urlparse(url) + 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'),