mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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:
parent
14bba3eadc
commit
30e69528a9
@ -247,7 +247,10 @@ class NetworkAccessManager(QNetworkAccessManager):
|
|||||||
if iswindows and path.startswith('/'):
|
if iswindows and path.startswith('/'):
|
||||||
path = path[1:]
|
path = path[1:]
|
||||||
c = current_container()
|
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):
|
if c.has_name(name):
|
||||||
try:
|
try:
|
||||||
return NetworkReply(self, request, c.mime_map.get(name, 'application/octet-stream'), name)
|
return NetworkReply(self, request, c.mime_map.get(name, 'application/octet-stream'), name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user