From d65f169f615ab11855acea3c49f8bdeb6024f40e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 8 Feb 2010 21:24:45 -0700 Subject: [PATCH] Fix #4783 (issue when importing an HTML file with an a/@href containing &) --- src/calibre/ebooks/html/input.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/html/input.py b/src/calibre/ebooks/html/input.py index 0bb7fc327c..8d33023e43 100644 --- a/src/calibre/ebooks/html/input.py +++ b/src/calibre/ebooks/html/input.py @@ -408,7 +408,10 @@ class HTMLInput(InputFormatPlugin): return link_ if base and not os.path.isabs(link): link = os.path.join(base, link) - link = os.path.abspath(link) + try: + link = os.path.abspath(link) + except: + return link_ if not os.access(link, os.R_OK): return link_ if os.path.isdir(link):