cpython: f6008e936fbc (original) (raw)

Mercurial > cpython

changeset 74546:f6008e936fbc 2.7

Fix Issue6631 - Disallow relative files paths in urllib*.open()

Senthil Kumaran senthil@uthcode.com
date Sat, 21 Jan 2012 11:43:02 +0800
parents 5ecf650ede7c
children 4366c0df2c73
files Lib/test/test_urllib.py Lib/test/test_urllib2net.py Lib/urllib.py
diffstat 3 files changed, 7 insertions(+), 0 deletions(-)[+] [-] Lib/test/test_urllib.py 3 Lib/test/test_urllib2net.py 2 Lib/urllib.py 2

line wrap: on

line diff

--- a/Lib/test/test_urllib.py +++ b/Lib/test/test_urllib.py @@ -134,6 +134,9 @@ class urlopen_FileTests(unittest.TestCas for line in self.returned_obj.iter(): self.assertEqual(line, self.text)

+ class ProxyTests(unittest.TestCase): def setUp(self):

--- a/Lib/test/test_urllib2net.py +++ b/Lib/test/test_urllib2net.py @@ -126,6 +126,8 @@ class OtherNetworkTests(unittest.TestCas finally: os.remove(TESTFN)

+ # XXX Following test depends on machine configurations that are internal # to CNRI. Need to set up a public server with the right authentication # configuration for test purposes.

--- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -484,6 +484,8 @@ class URLopener: urlfile = file if file[:1] == '/': urlfile = 'file://' + file