mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Chore: switch from os.path to pathlib.Path (#9060)
This commit is contained in:

committed by
GitHub

parent
aaaa6c1393
commit
76d363f22d
@@ -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.
|
||||
|
Reference in New Issue
Block a user