Chore: switch from os.path to pathlib.Path (#9060)

This commit is contained in:
Sebastian Steinbeißer
2025-03-05 22:06:01 +01:00
committed by GitHub
parent aaaa6c1393
commit 76d363f22d
17 changed files with 89 additions and 150 deletions

View File

@@ -315,7 +315,7 @@ class Document(SoftDeleteModel, ModelWithOwner):
@property
def source_file(self):
return open(self.source_path, "rb")
return Path(self.source_path).open("rb")
@property
def has_archive_version(self) -> bool:
@@ -330,7 +330,7 @@ class Document(SoftDeleteModel, ModelWithOwner):
@property
def archive_file(self):
return open(self.archive_path, "rb")
return Path(self.archive_path).open("rb")
def get_public_filename(self, *, archive=False, counter=0, suffix=None) -> str:
"""
@@ -367,7 +367,7 @@ class Document(SoftDeleteModel, ModelWithOwner):
@property
def thumbnail_file(self):
return open(self.thumbnail_path, "rb")
return Path(self.thumbnail_path).open("rb")
@property
def created_date(self):