merge from 3.2

This commit is contained in:
Senthil Kumaran 2012-01-21 11:55:40 +08:00
commit 3242577a08
4 changed files with 8 additions and 2 deletions

View file

@ -1813,6 +1813,8 @@ class URLopener:
urlfile = file
if file[:1] == '/':
urlfile = 'file://' + file
elif file[:2] == './':
raise ValueError("local file url may start with / or file:. Unknown url of type: %s" % url)
return addinfourl(open(localname, 'rb'), headers, urlfile)
raise URLError('local file error', 'not on local host')