Some changes (maybe not enough?) to make it work on Windows with local

file URLs.
This commit is contained in:
Guido van Rossum 1999-04-26 23:11:46 +00:00
parent 26c2cb4bd1
commit 0ec1493d0b
1 changed files with 3 additions and 3 deletions

View File

@ -606,9 +606,9 @@ class MyURLopener(urllib.FancyURLopener):
def open_file(self, url):
path = urllib.url2pathname(urllib.unquote(url))
if path[-1] != os.sep:
url = url + '/'
if os.path.isdir(path):
if path[-1] != os.sep:
url = url + '/'
indexpath = os.path.join(path, "index.html")
if os.path.exists(indexpath):
return self.open_file(url + "index.html")
@ -625,7 +625,7 @@ class MyURLopener(urllib.FancyURLopener):
s.write('<A HREF="%s">%s</A>\n' % (q, q))
s.seek(0)
return s
return urllib.FancyURLopener.open_file(self, path)
return urllib.FancyURLopener.open_file(self, url)
class MyHTMLParser(sgmllib.SGMLParser):