aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2020-08-15 15:49:33 +0200
committerneodarz <neodarz@neodarz.net>2020-08-15 15:49:33 +0200
commit2e3e8371c34bebd46bdc79fc7778d8f250d87f0c (patch)
tree6fe68c00cc6a46a1bae36b41316a3a07768ed14e
parent3556ac08ca198db5fd7b71e712d6fc7a02f16e38 (diff)
downloadmusic_downloader-2e3e8371c34bebd46bdc79fc7778d8f250d87f0c.tar.xz
music_downloader-2e3e8371c34bebd46bdc79fc7778d8f250d87f0c.zip
Convert filename to path before try to open it
-rw-r--r--utils.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/utils.py b/utils.py
index 2736206..58188b1 100644
--- a/utils.py
+++ b/utils.py
@@ -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!')