mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
96bc6a8877
commit
35f2e04f91
@ -167,7 +167,12 @@ def case_preserving_open_file(path, mode='wb', mkdir_mode=0777):
|
|||||||
raise
|
raise
|
||||||
# This component already exists, ensure the case is correct
|
# This component already exists, ensure the case is correct
|
||||||
cl = comp.lower()
|
cl = comp.lower()
|
||||||
|
try:
|
||||||
candidates = [c for c in os.listdir(cpath) if c.lower() == cl]
|
candidates = [c for c in os.listdir(cpath) if c.lower() == cl]
|
||||||
|
except:
|
||||||
|
# No permission to do a listdir, just use the original case
|
||||||
|
pass
|
||||||
|
else:
|
||||||
if len(candidates) == 1:
|
if len(candidates) == 1:
|
||||||
cdir = os.path.join(cpath, candidates[0])
|
cdir = os.path.join(cpath, candidates[0])
|
||||||
# else: We are on a case sensitive file system so cdir must already
|
# else: We are on a case sensitive file system so cdir must already
|
||||||
|
Loading…
x
Reference in New Issue
Block a user