From 106d2cc2ebf68dfc49cbe7c50b86a5808cbfc787 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 24 Oct 2014 19:01:23 +0530 Subject: [PATCH] Edit Book: Fix links that are absolute paths causing crashes in windows --- src/calibre/gui2/tweak_book/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/__init__.py b/src/calibre/gui2/tweak_book/__init__.py index 583ba9858c..5e8b852ca7 100644 --- a/src/calibre/gui2/tweak_book/__init__.py +++ b/src/calibre/gui2/tweak_book/__init__.py @@ -114,7 +114,10 @@ def set_book_locale(lang): def verify_link(url, name=None): if _current_container is None or name is None: return None - target = _current_container.href_to_name(url, name) + try: + target = _current_container.href_to_name(url, name) + except ValueError: + return False # Absolute URLs that point to a different drive on windows cause this if _current_container.has_name(target): return True if url.startswith('#'):