1
0
mirror of https://github.com/instaloader/instaloader.git synced 2024-07-07 11:42:38 +02:00

Make latest-stamps create intermediate directories (#1500)

Fixes #1467
This commit is contained in:
canh 2022-04-21 18:23:41 +02:00 committed by GitHub
parent 0704602e50
commit 644fab1f5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,8 @@
import configparser
from datetime import datetime, timezone
from typing import Optional
from os.path import dirname
from os import makedirs
class LatestStamps:
@ -25,6 +27,7 @@ class LatestStamps:
self.data.read(latest_stamps_file)
def _save(self):
makedirs(dirname(self.file), exist_ok=True)
with open(self.file, 'w') as f:
self.data.write(f)