Use pathclass.Path.open.

master
voussoir 2020-09-20 18:31:31 -07:00
parent 55e66c8656
commit 2accb5c961
2 changed files with 2 additions and 2 deletions

View File

@ -329,7 +329,7 @@ def read_filebytes(filepath, range_min=0, range_max=None, chunk_size=bytestring.
range_max = filepath.size
range_span = (range_max + 1) - range_min
f = open(filepath.absolute_path, 'rb')
f = filepath.open('rb')
sent_amount = 0
with f:
f.seek(range_min)

View File

@ -1826,7 +1826,7 @@ class PhotoDB(
self.save_config()
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))
if __name__ == '__main__':