mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54: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:
|
if not fmts and not self.opts.write_opf and not self.opts.save_cover:
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
# On windows python incorrectly raises an access denied exception
|
||||||
os.makedirs(base_dir)
|
# when trying to create the root of a drive, like C:\
|
||||||
except EnvironmentError as err:
|
if os.path.dirname(base_dir) != base_dir:
|
||||||
if err.errno != errno.EEXIST:
|
try:
|
||||||
raise
|
os.makedirs(base_dir)
|
||||||
|
except EnvironmentError as err:
|
||||||
|
if err.errno != errno.EEXIST:
|
||||||
|
raise
|
||||||
|
|
||||||
if self.opts.update_metadata:
|
if self.opts.update_metadata:
|
||||||
d = {}
|
d = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user