CHM Input: Yet another regression opening CHM files with missing internal files on windows. See #2023377 (Since the last update Calibre cannot open some of my ebooks.) [Since the last update Calibre cannot open some of my ebooks.](https://bugs.launchpad.net/calibre/+bug/2023377)

This commit is contained in:
Kovid Goyal 2023-06-09 16:01:07 +05:30
parent 0acd1a8182
commit a1b874398d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -623,9 +623,13 @@ if iswindows:
def get_long_path_name(path): def get_long_path_name(path):
from calibre_extensions.winutil import get_long_path_name from calibre_extensions.winutil import get_long_path_name
if os.path.isabs(path) and not path.startswith(long_path_prefix): lpath = path
path = long_path_prefix + path if os.path.isabs(lpath) and not lpath.startswith(long_path_prefix):
return get_long_path_name(path) lpath = long_path_prefix + lpath
try:
return get_long_path_name(lpath)
except FileNotFoundError:
return path
else: else:
def make_long_path_useable(path): def make_long_path_useable(path):