Ensure all creations of directories create the parents too (#5711)

This commit is contained in:
Trenton H 2024-02-10 11:02:40 -08:00 committed by GitHub
parent 0b1523f4e5
commit 13201dbfff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 22 additions and 38 deletions

View file

@ -710,7 +710,7 @@ class MailAccountHandler(LoggingMixin):
f"{message.subject} from {message.from_}",
)
os.makedirs(settings.SCRATCH_DIR, exist_ok=True)
settings.SCRATCH_DIR.mkdir(parents=True, exist_ok=True)
temp_dir = Path(
tempfile.mkdtemp(
@ -793,7 +793,7 @@ class MailAccountHandler(LoggingMixin):
tag_ids,
doc_type,
):
os.makedirs(settings.SCRATCH_DIR, exist_ok=True)
settings.SCRATCH_DIR.mkdir(parents=True, exist_ok=True)
_, temp_filename = tempfile.mkstemp(
prefix="paperless-mail-",
dir=settings.SCRATCH_DIR,