From 248152c24a8724fec31a7efe3bab4ee4518c780b Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 20 Sep 2020 18:32:19 -0700 Subject: [PATCH] Use pathclass.Path.open. --- ycdl/ycdldb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ycdl/ycdldb.py b/ycdl/ycdldb.py index b814ab0..2869f30 100644 --- a/ycdl/ycdldb.py +++ b/ycdl/ycdldb.py @@ -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))