Fix for Issue7751: urllib.urlopen("///C|/foo/bar/spam.foo")

This commit is contained in:
Senthil Kumaran 2010-02-20 22:05:34 +00:00
parent e3467d5c96
commit 18d5a69669
2 changed files with 6 additions and 2 deletions

View file

@ -179,7 +179,7 @@ class URLopener:
fullurl = unwrap(toBytes(fullurl))
# percent encode url, fixing lame server errors for e.g, like space
# within url paths.
fullurl = quote(fullurl, safe="%/:=&?~#+!$,;'@()*[]")
fullurl = quote(fullurl, safe="%/:=&?~#+!$,;'@()*[]|")
if self.tempcache and fullurl in self.tempcache:
filename, headers = self.tempcache[fullurl]
fp = open(filename, 'rb')