Raise FileNotFound from read_filebytes.

This commit is contained in:
voussoir 2019-12-10 12:48:28 -08:00
parent c984159a76
commit 3bd8fe6392

View file

@ -324,6 +324,8 @@ def read_filebytes(filepath, range_min=0, range_max=None, chunk_size=bytestring.
Yield chunks of bytes from the file between the endpoints.
'''
filepath = pathclass.Path(filepath)
if not filepath.exists:
raise FileNotFoundError(filepath)
if range_max is None:
range_max = filepath.size
range_span = (range_max + 1) - range_min