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)
This commit is contained in:
Kovid Goyal 2013-12-16 17:40:31 +05:30
parent 14bba3eadc
commit 30e69528a9

View File

@ -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)