diff options
author | neodarz <neodarz@neodarz.net> | 2020-08-15 15:49:33 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2020-08-15 15:49:33 +0200 |
commit | 2e3e8371c34bebd46bdc79fc7778d8f250d87f0c (patch) | |
tree | 6fe68c00cc6a46a1bae36b41316a3a07768ed14e | |
parent | 3556ac08ca198db5fd7b71e712d6fc7a02f16e38 (diff) | |
download | music_downloader-2e3e8371c34bebd46bdc79fc7778d8f250d87f0c.tar.xz music_downloader-2e3e8371c34bebd46bdc79fc7778d8f250d87f0c.zip |
Convert filename to path before try to open it
Diffstat (limited to '')
-rw-r--r-- | utils.py | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -1,9 +1,11 @@ import sys import logging +from pathlib import Path def read_file(filename): lines = [] + filename = Path(filename) if filename.is_dir(): logging.fatal(f'{filename} is a folder instead of a file!') |