summaryrefslogtreecommitdiffstats
path: root/Tools/webchecker
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-06-15 12:34:41 (GMT)
committerGuido van Rossum <guido@python.org>1998-06-15 12:34:41 (GMT)
commitd328a9b5f41b38d6127d697b0f9fb5f85e52adfa (patch)
treeb24a02b85949331af3ccc5466aba2ca727473e16 /Tools/webchecker
parent6eb9d32c436af46527ed5874af4f3ce4fe5a6ccb (diff)
downloadcpython-d328a9b5f41b38d6127d697b0f9fb5f85e52adfa.zip
cpython-d328a9b5f41b38d6127d697b0f9fb5f85e52adfa.tar.gz
cpython-d328a9b5f41b38d6127d697b0f9fb5f85e52adfa.tar.bz2
Fix the way a trailing / is changed to /index.html so that it
doesn't depend on the value of os.sep. (I.e. ported to Windows :-)
Diffstat (limited to 'Tools/webchecker')
-rwxr-xr-xTools/webchecker/websucker.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Tools/webchecker/websucker.py b/Tools/webchecker/websucker.py
index 852df07..7ee2535 100755
--- a/Tools/webchecker/websucker.py
+++ b/Tools/webchecker/websucker.py
@@ -85,10 +85,11 @@ class Sucker(webchecker.Checker):
user, host = urllib.splituser(host)
host, port = urllib.splitnport(host)
host = string.lower(host)
- path = os.path.join(host, path)
- if path[-1] == "/": path = path + "index.html"
+ if not path or path[-1] == "/":
+ path = path + "index.html"
if os.sep != "/":
path = string.join(string.split(path, "/"), os.sep)
+ path = os.path.join(host, path)
return path
def makedirs(dir):