From bab08369b96943f3556e2ef7f043b584104fabde Mon Sep 17 00:00:00 2001 From: j Date: Mon, 4 Nov 2024 17:40:57 +0000 Subject: [PATCH] target might be in current folder --- ox/net.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ox/net.py b/ox/net.py index 1fd4d87..696cabb 100644 --- a/ox/net.py +++ b/ox/net.py @@ -113,7 +113,8 @@ get_url = read_url def save_url(url, filename, overwrite=False): if not os.path.exists(filename) or overwrite: dirname = os.path.dirname(filename) - os.makedirs(dirname, exist_ok=True) + if dirname: + os.makedirs(dirname, exist_ok=True) headers = DEFAULT_HEADERS.copy() r = requests.get(url, headers=headers, stream=True) filename_tmp = filename + '~'