mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-03-03 16:46:00 +01:00
Save to disk: Fix a regression that prevented saving of files into the root of a drive on windows
This commit is contained in:
parent
b5849698c0
commit
ea222f75be
1 changed files with 8 additions and 5 deletions
|
|
@ -212,11 +212,14 @@ def write_book(self, book_id, mi, components, fmts):
|
|||
if not fmts and not self.opts.write_opf and not self.opts.save_cover:
|
||||
return
|
||||
|
||||
try:
|
||||
os.makedirs(base_dir)
|
||||
except EnvironmentError as err:
|
||||
if err.errno != errno.EEXIST:
|
||||
raise
|
||||
# On windows python incorrectly raises an access denied exception
|
||||
# when trying to create the root of a drive, like C:\
|
||||
if os.path.dirname(base_dir) != base_dir:
|
||||
try:
|
||||
os.makedirs(base_dir)
|
||||
except EnvironmentError as err:
|
||||
if err.errno != errno.EEXIST:
|
||||
raise
|
||||
|
||||
if self.opts.update_metadata:
|
||||
d = {}
|
||||
|
|
|
|||
Loading…
Reference in a new issue