Use pathclass.Path.open.

This commit is contained in:
voussoir 2020-09-20 18:32:19 -07:00
parent 69c1dd92e9
commit 248152c24a

View file

@ -329,7 +329,7 @@ class YCDLDBVideoMixin:
os.makedirs(download_directory.absolute_path, exist_ok=True)
queuefile = download_directory.with_child(video_id).replace_extension(extension)
open(queuefile.absolute_path, 'a').close()
queuefile.touch()
video.mark_state('downloaded', commit=False)
@ -549,5 +549,5 @@ class YCDLDB(
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))