summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllib.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2020-06-25 14:56:31 (GMT)
committerGitHub <noreply@github.com>2020-06-25 14:56:31 (GMT)
commit700cfa8c90a90016638bac13c4efd03786b2b2a0 (patch)
tree62994f7b8d6fccd910d5f65bd6cd49a4f72bf8ae /Lib/test/test_urllib.py
parent8ea6353f60625c96ce96588c70ff24a77f8c71f9 (diff)
downloadcpython-700cfa8c90a90016638bac13c4efd03786b2b2a0.zip
cpython-700cfa8c90a90016638bac13c4efd03786b2b2a0.tar.gz
cpython-700cfa8c90a90016638bac13c4efd03786b2b2a0.tar.bz2
bpo-41069: Make TESTFN and the CWD for tests containing non-ascii characters. (GH-21035)
Diffstat (limited to 'Lib/test/test_urllib.py')
-rw-r--r--Lib/test/test_urllib.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
index ebeb9a0..68bb49e 100644
--- a/Lib/test/test_urllib.py
+++ b/Lib/test/test_urllib.py
@@ -151,7 +151,8 @@ class urlopen_FileTests(unittest.TestCase):
finally:
f.close()
self.pathname = support.TESTFN
- self.returned_obj = urlopen("file:%s" % self.pathname)
+ self.quoted_pathname = urllib.parse.quote(self.pathname)
+ self.returned_obj = urlopen("file:%s" % self.quoted_pathname)
def tearDown(self):
"""Shut down the open object"""
@@ -198,7 +199,7 @@ class urlopen_FileTests(unittest.TestCase):
self.assertIsInstance(self.returned_obj.headers, email.message.Message)
def test_url(self):
- self.assertEqual(self.returned_obj.url, self.pathname)
+ self.assertEqual(self.returned_obj.url, self.quoted_pathname)
def test_status(self):
self.assertIsNone(self.returned_obj.status)
@@ -207,7 +208,7 @@ class urlopen_FileTests(unittest.TestCase):
self.assertIsInstance(self.returned_obj.info(), email.message.Message)
def test_geturl(self):
- self.assertEqual(self.returned_obj.geturl(), self.pathname)
+ self.assertEqual(self.returned_obj.geturl(), self.quoted_pathname)
def test_getcode(self):
self.assertIsNone(self.returned_obj.getcode())