1
0
mirror of https://github.com/instaloader/instaloader.git synced 2024-08-18 12:49:38 +02:00

Fix rare FileNotFoundError in resumable_iterator()

... that occured when using a path name for the FrozenNodeIterator file
whose dirname was ''.
This commit is contained in:
Alexander Graf 2020-12-02 19:26:27 +01:00
parent ed3fce45da
commit 3530cdc55c

View File

@ -263,7 +263,8 @@ def resumable_iteration(context: InstaloaderContext,
try:
yield is_resuming, start_index
except KeyboardInterrupt:
os.makedirs(os.path.dirname(resume_file_path), exist_ok=True)
if os.path.dirname(resume_file_path):
os.makedirs(os.path.dirname(resume_file_path), exist_ok=True)
save(iterator.freeze(), resume_file_path)
context.log("\nSaved resume information to {}.".format(resume_file_path))
raise