diff options
| author | Cody Logan <cody@lokken.dev> | 2023-11-08 09:56:10 -0800 |
|---|---|---|
| committer | Cody Logan <cody@lokken.dev> | 2023-11-08 09:56:10 -0800 |
| commit | e8da17d8c6b7fd879e196ae425b8e62c78e579fe (patch) | |
| tree | d782d7c1b8a88fcab69820d18a788e377f82c454 /src/wikiget/validations.py | |
| parent | 456316f882834c33e90a2ddfa8d4c5e47966dc5e (diff) | |
| download | wikiget-e8da17d8c6b7fd879e196ae425b8e62c78e579fe.tar.gz wikiget-e8da17d8c6b7fd879e196ae425b8e62c78e579fe.zip | |
Switch to pathlib for file processing
Diffstat (limited to 'src/wikiget/validations.py')
| -rw-r--r-- | src/wikiget/validations.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wikiget/validations.py b/src/wikiget/validations.py index cfbc5ef..ee73b87 100644 --- a/src/wikiget/validations.py +++ b/src/wikiget/validations.py @@ -19,6 +19,7 @@ from __future__ import annotations import hashlib import re +from pathlib import Path from wikiget import BLOCKSIZE @@ -68,7 +69,7 @@ def verify_hash(filename: str) -> str: :rtype: str """ hasher = hashlib.sha1() # noqa: S324 - with open(filename, "rb") as dl: + with Path(filename).open("rb") as dl: buf = dl.read(BLOCKSIZE) while len(buf) > 0: hasher.update(buf) |
