mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix regression causing failure to start if one of the previously used libraries no longer exists. Fixes #1907773 [After Update 5.7 - Defect by Start](https://bugs.launchpad.net/calibre/+bug/1907773)
This commit is contained in:
parent
9e09d44aca
commit
c6d738ef6d
@ -65,11 +65,14 @@ def library_id_from_path(path, existing=frozenset()):
|
||||
def correct_case_of_last_path_component(original_path):
|
||||
prefix, basename = os.path.split(original_path)
|
||||
q = basename.lower()
|
||||
try:
|
||||
equals = tuple(x for x in os.listdir(prefix) if x.lower() == q)
|
||||
except OSError:
|
||||
equals = ()
|
||||
if len(equals) > 1:
|
||||
if basename not in equals:
|
||||
basename = equals[0]
|
||||
else:
|
||||
elif equals:
|
||||
basename = equals[0]
|
||||
return os.path.join(prefix, basename)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user