remove 'exist_ok=True' argument from several os.makedirs calls
makedirs in those places is only meant to create missing directories, anything should be considered an error
This commit is contained in:
parent
9c8647a4fd
commit
d1bb7fae2d
@ -141,7 +141,7 @@ class PathFormat():
|
|||||||
try:
|
try:
|
||||||
return open(self.temppath, mode)
|
return open(self.temppath, mode)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
os.makedirs(self.realdirectory, exist_ok=True)
|
os.makedirs(self.realdirectory)
|
||||||
return open(self.temppath, mode)
|
return open(self.temppath, mode)
|
||||||
|
|
||||||
def exists(self):
|
def exists(self):
|
||||||
@ -322,7 +322,7 @@ class PathFormat():
|
|||||||
os.replace(self.temppath, self.realpath)
|
os.replace(self.temppath, self.realpath)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
# delayed directory creation
|
# delayed directory creation
|
||||||
os.makedirs(self.realdirectory, exist_ok=True)
|
os.makedirs(self.realdirectory)
|
||||||
continue
|
continue
|
||||||
except OSError:
|
except OSError:
|
||||||
# move across different filesystems
|
# move across different filesystems
|
||||||
|
@ -95,7 +95,7 @@ class MetadataPP(PostProcessor):
|
|||||||
with open(path, "w", encoding="utf-8") as fp:
|
with open(path, "w", encoding="utf-8") as fp:
|
||||||
self.write(fp, pathfmt.kwdict)
|
self.write(fp, pathfmt.kwdict)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
os.makedirs(directory, exist_ok=True)
|
os.makedirs(directory)
|
||||||
with open(path, "w", encoding="utf-8") as fp:
|
with open(path, "w", encoding="utf-8") as fp:
|
||||||
self.write(fp, pathfmt.kwdict)
|
self.write(fp, pathfmt.kwdict)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user