Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d328a9b

Browse files
committed
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 :-)
1 parent 6eb9d32 commit d328a9b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Tools/webchecker/websucker.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,11 @@ def savefilename(self, url):
8585
user, host = urllib.splituser(host)
8686
host, port = urllib.splitnport(host)
8787
host = string.lower(host)
88-
path = os.path.join(host, path)
89-
if path[-1] == "/": path = path + "index.html"
88+
if not path or path[-1] == "/":
89+
path = path + "index.html"
9090
if os.sep != "/":
9191
path = string.join(string.split(path, "/"), os.sep)
92+
path = os.path.join(host, path)
9293
return path
9394

9495
def makedirs(dir):

0 commit comments

Comments
 (0)