diff --git a/linkcheck/checker/__init__.py b/linkcheck/checker/__init__.py index a859162c..d8bcb9d6 100644 --- a/linkcheck/checker/__init__.py +++ b/linkcheck/checker/__init__.py @@ -101,12 +101,13 @@ def get_url_from (base_url, recursion_level, aggregate, base_ref = strformat.unicode_safe(base_ref) name = strformat.unicode_safe(name) url = absolute_url(base_url_stripped, base_ref, parent_url).lower() - scheme = None - if not (url or name): - # use filename as base url, with slash as path seperator - name = base_url.replace("\\", "/") - elif ":" in url: + if ":" in url: scheme = url.split(":", 1)[0].lower() + else: + scheme = None + if not (url or name): + # use filename as base url, with slash as path seperator + name = base_url.replace("\\", "/") allowed_schemes = aggregate.config["allowedschemes"] # ignore local PHP files with execution directives local_php = (parent_content_type == 'application/x-httpd-php' and diff --git a/linkcheck/htmlutil/linkparse.py b/linkcheck/htmlutil/linkparse.py index 3196d0a5..adb4f347 100644 --- a/linkcheck/htmlutil/linkparse.py +++ b/linkcheck/htmlutil/linkparse.py @@ -275,9 +275,6 @@ class LinkFinder (TagFinder): urls.extend(url.split(u',')) else: urls.append(url) - if not urls: - # no url found - return for u in urls: assert isinstance(u, unicode) or u is None, repr(u) log.debug(LOG_CHECK, u"LinkParser found link %r %r %r %r %r", tag, attr, u, name, base) diff --git a/scripts/nodebug.sh b/scripts/nodebug.sh new file mode 100755 index 00000000..fb42f714 --- /dev/null +++ b/scripts/nodebug.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# deactivate all debug calls +set -e +set -u + +d=$(dirname $0) +base=$(readlink -f $d/..) +find "$base" -type f -print0 | xargs -0 sed -i 's/ log.debug(/ #log.debug(/g' diff --git a/scripts/viewprof.py b/scripts/viewprof.py old mode 100644 new mode 100755