Save to disk: Fix a regression that prevented saving of files into the root of a drive on windows

This commit is contained in:
Kovid Goyal 2014-12-17 08:46:46 +05:30
parent b5849698c0
commit ea222f75be

View File

@ -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 = {}