Windows: Fix regression causing error when choosing save file names

Fixes #1902247 [Error when exporting files from Edit book](https://bugs.launchpad.net/calibre/+bug/1902247)
This commit is contained in:
Kovid Goyal 2020-10-30 21:22:40 +05:30
parent 0035170828
commit b7e6b8fbee
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -227,7 +227,11 @@ def run_file_dialog(
def fix_path(x): def fix_path(x):
u = os.path.abspath(x.decode('utf-8')) u = os.path.abspath(x.decode('utf-8'))
try:
return get_long_path_name(u) return get_long_path_name(u)
except FileNotFoundError:
base, fn = os.path.split(u)
return os.path.join(get_long_path_name(base), fn)
ans = tuple(map(fix_path, parts[1:])) ans = tuple(map(fix_path, parts[1:]))
return ans return ans