From 4c30684322f9221974f854f2b820cb335d3dfd80 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 24 Mar 2008 20:57:26 +0000 Subject: [PATCH] Fix bug in web2disk that caused download of some webpages that have empty hrefs to fail. --- src/libprs500/web/fetch/simple.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libprs500/web/fetch/simple.py b/src/libprs500/web/fetch/simple.py index 3d115d4340..e06786f52a 100644 --- a/src/libprs500/web/fetch/simple.py +++ b/src/libprs500/web/fetch/simple.py @@ -49,7 +49,7 @@ def save_soup(soup, target): for tag in soup.findAll(['img', 'link', 'a']): for key in ('src', 'href'): path = tag.get(key, None) - if path and os.path.exists(path) and os.path.isabs(path): + if path and os.path.isfile(path) and os.path.exists(path) and os.path.isabs(path): tag[key] = relpath(path, selfdir).replace(os.sep, '/') f = codecs.open(target, 'w', 'utf-8')