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

@@ -272,7 +272,7 @@ def update_document_content_maybe_archive_file(document_id):
with transaction.atomic():
oldDocument = Document.objects.get(pk=document.pk)
if parser.get_archive_path():
with open(parser.get_archive_path(), "rb") as f:
with Path(parser.get_archive_path()).open("rb") as f:
checksum = hashlib.md5(f.read()).hexdigest()
# I'm going to save first so that in case the file move
# fails, the database is rolled back.