summaryrefslogtreecommitdiffstats
path: root/Lib/urllib
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2012-01-21 03:55:40 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2012-01-21 03:55:40 (GMT)
commit3242577a0875c08a7fb714628a7f0ee58813cece (patch)
treee323e43adf93835ebe9733c1a65aba68b86e3cb6 /Lib/urllib
parent77fc1f3c066e244768faa37b52db7415906251f3 (diff)
parent3800ea9f652817e510a0db27bf124d2b80e7be10 (diff)
downloadcpython-3242577a0875c08a7fb714628a7f0ee58813cece.zip
cpython-3242577a0875c08a7fb714628a7f0ee58813cece.tar.gz
cpython-3242577a0875c08a7fb714628a7f0ee58813cece.tar.bz2
merge from 3.2
Diffstat (limited to 'Lib/urllib')
-rw-r--r--Lib/urllib/request.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index c9f2c1d..90dfcff 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -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')