mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
merge from 3.2
This commit is contained in:
commit
3242577a08
4 changed files with 8 additions and 2 deletions
|
|
@ -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')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue