Raise FileNotFound from read_filebytes.
This commit is contained in:
		
							parent
							
								
									c984159a76
								
							
						
					
					
						commit
						3bd8fe6392
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -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. |     Yield chunks of bytes from the file between the endpoints. | ||||||
|     ''' |     ''' | ||||||
|     filepath = pathclass.Path(filepath) |     filepath = pathclass.Path(filepath) | ||||||
|  |     if not filepath.exists: | ||||||
|  |         raise FileNotFoundError(filepath) | ||||||
|     if range_max is None: |     if range_max is None: | ||||||
|         range_max = filepath.size |         range_max = filepath.size | ||||||
|     range_span = (range_max + 1) - range_min |     range_span = (range_max + 1) - range_min | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue