Fix use of mebibyte.

This commit is contained in:
voussoir 2022-11-18 21:37:57 -08:00
parent 9ecf058242
commit 96b10126ec
2 changed files with 2 additions and 2 deletions

View file

@ -24,7 +24,7 @@ def hash_file(filepath, hasher):
def hash_file_md5(filepath): def hash_file_md5(filepath):
return hash_file(filepath, hasher=hashlib.md5()) return hash_file(filepath, hasher=hashlib.md5())
def read_filebytes(filepath, chunk_size=bytestring.MIBIBYTE): def read_filebytes(filepath, chunk_size=bytestring.MEBIBYTE):
filepath = pathclass.Path(filepath) filepath = pathclass.Path(filepath)
if not filepath.is_file: if not filepath.is_file:
raise FileNotFoundError(filepath) raise FileNotFoundError(filepath)

View file

@ -269,7 +269,7 @@ def _normalize_volume(volume, pathsize):
if volume.endswith('%'): if volume.endswith('%'):
volume = volume[:-1] volume = volume[:-1]
volume = float(volume) / 100 volume = float(volume) / 100
volume = (pathsize * volume) / bytestring.MIBIBYTE volume = (pathsize * volume) / bytestring.MEBIBYTE
volume = max(1, volume) volume = max(1, volume)
return int(volume) return int(volume)