mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04: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
@ -212,11 +212,14 @@ class Saver(QObject):
|
||||
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…
x
Reference in New Issue
Block a user