mirror of https://github.com/python/cpython
Merged revisions 78270 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r78270 | senthil.kumaran | 2010-02-21 03:49:04 +0530 (Sun, 21 Feb 2010) | 4 lines Merged revisions 78268 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........
This commit is contained in:
parent
39440b14cd
commit
0e7e9aee59
|
@ -113,7 +113,6 @@ class urlopen_FileTests(unittest.TestCase):
|
||||||
for line in self.returned_obj.__iter__():
|
for line in self.returned_obj.__iter__():
|
||||||
self.assertEqual(line, self.text)
|
self.assertEqual(line, self.text)
|
||||||
|
|
||||||
|
|
||||||
class ProxyTests(unittest.TestCase):
|
class ProxyTests(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
@ -868,6 +867,11 @@ class URLopener_Tests(unittest.TestCase):
|
||||||
self.assertEqual(DummyURLopener().open(
|
self.assertEqual(DummyURLopener().open(
|
||||||
'spam://example/ /'),'//example/%20/')
|
'spam://example/ /'),'//example/%20/')
|
||||||
|
|
||||||
|
# test the safe characters are not quoted by urlopen
|
||||||
|
self.assertEqual(DummyURLopener().open(
|
||||||
|
"spam://c:|windows%/:=&?~#+!$,;'@()*[]|/path/"),
|
||||||
|
"//c:|windows%/:=&?~#+!$,;'@()*[]|/path/")
|
||||||
|
|
||||||
# Just commented them out.
|
# Just commented them out.
|
||||||
# Can't really tell why keep failing in windows and sparc.
|
# Can't really tell why keep failing in windows and sparc.
|
||||||
# Everywhere else they work ok, but on those machines, someteimes
|
# Everywhere else they work ok, but on those machines, someteimes
|
||||||
|
|
|
@ -1426,7 +1426,7 @@ class URLopener:
|
||||||
def open(self, fullurl, data=None):
|
def open(self, fullurl, data=None):
|
||||||
"""Use URLopener().open(file) instead of open(file, 'r')."""
|
"""Use URLopener().open(file) instead of open(file, 'r')."""
|
||||||
fullurl = unwrap(to_bytes(fullurl))
|
fullurl = unwrap(to_bytes(fullurl))
|
||||||
fullurl = quote(fullurl, safe="%/:=&?~#+!$,;'@()*[]")
|
fullurl = quote(fullurl, safe="%/:=&?~#+!$,;'@()*[]|")
|
||||||
if self.tempcache and fullurl in self.tempcache:
|
if self.tempcache and fullurl in self.tempcache:
|
||||||
filename, headers = self.tempcache[fullurl]
|
filename, headers = self.tempcache[fullurl]
|
||||||
fp = open(filename, 'rb')
|
fp = open(filename, 'rb')
|
||||||
|
|
Loading…
Reference in New Issue