create path on msd image uploading

This commit is contained in:
Maxim Devaev 2023-03-06 19:21:16 +02:00
parent cd3c28e97f
commit 3c29e8f61a

View File

@ -269,6 +269,7 @@ class MsdFileWriter(BaseMsdWriter): # pylint: disable=too-many-instance-attribu
async def open(self) -> "MsdFileWriter":
assert self.__file is None
get_logger(1).info("Writing %r image (%d bytes) to MSD ...", self.__name, self.__file_size)
os.makedirs(os.path.dirname(self.__path), exist_ok=True)
self.__file = await aiofiles.open(self.__path, mode="w+b", buffering=0) # type: ignore
return self