From 30e69528a9fae5e4281065b1272ea045798e62b8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 16 Dec 2013 17:40:31 +0530 Subject: [PATCH] Edit book: Fix crash when editing books that have links to absolute paths. Fixes #1261337 [Edit Book dies with "Value Error: path is on drive D: start on drive C:](https://bugs.launchpad.net/calibre/+bug/1261337) --- src/calibre/gui2/tweak_book/preview.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/preview.py b/src/calibre/gui2/tweak_book/preview.py index dc7902d7a7..bbcd94b032 100644 --- a/src/calibre/gui2/tweak_book/preview.py +++ b/src/calibre/gui2/tweak_book/preview.py @@ -247,7 +247,10 @@ class NetworkAccessManager(QNetworkAccessManager): if iswindows and path.startswith('/'): path = path[1:] c = current_container() - name = c.abspath_to_name(path) + try: + name = c.abspath_to_name(path) + except ValueError: # Happens on windows with absolute paths on different drives + name = None if c.has_name(name): try: return NetworkReply(self, request, c.mime_map.get(name, 'application/octet-stream'), name)