Use pathclass.Path.open.
This commit is contained in:
		
							parent
							
								
									55e66c8656
								
							
						
					
					
						commit
						2accb5c961
					
				
					 2 changed files with 2 additions and 2 deletions
				
			
		|  | @ -329,7 +329,7 @@ def read_filebytes(filepath, range_min=0, range_max=None, chunk_size=bytestring. | ||||||
|         range_max = filepath.size |         range_max = filepath.size | ||||||
|     range_span = (range_max + 1) - range_min |     range_span = (range_max + 1) - range_min | ||||||
| 
 | 
 | ||||||
|     f = open(filepath.absolute_path, 'rb') |     f = filepath.open('rb') | ||||||
|     sent_amount = 0 |     sent_amount = 0 | ||||||
|     with f: |     with f: | ||||||
|         f.seek(range_min) |         f.seek(range_min) | ||||||
|  |  | ||||||
|  | @ -1826,7 +1826,7 @@ class PhotoDB( | ||||||
|             self.save_config() |             self.save_config() | ||||||
| 
 | 
 | ||||||
|     def save_config(self): |     def save_config(self): | ||||||
|         with open(self.config_filepath.absolute_path, 'w', encoding='utf-8') as handle: |         with self.config_filepath.open('w', encoding='utf-8') as handle: | ||||||
|             handle.write(json.dumps(self.config, indent=4, sort_keys=True)) |             handle.write(json.dumps(self.config, indent=4, sort_keys=True)) | ||||||
| 
 | 
 | ||||||
| if __name__ == '__main__': | if __name__ == '__main__': | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue