Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a96fd48

Browse files
committed
merge 3.2 (#20695)
2 parents 665a2bc + 1b94030 commit a96fd48

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Lib/test/test_urllibnet.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def test_fileno(self):
103103
# Make sure fd returned by fileno is valid.
104104
with self.urlopen("http://www.python.org/", timeout=None) as open_url:
105105
fd = open_url.fileno()
106-
with os.fdopen(fd, encoding='utf-8') as f:
106+
with os.fdopen(fd, 'rb') as f:
107107
self.assertTrue(f.read(), "reading from file created using fd "
108108
"returned by fileno failed")
109109

@@ -151,7 +151,7 @@ def test_basic(self):
151151
with self.urlretrieve("http://www.python.org/") as (file_location, info):
152152
self.assertTrue(os.path.exists(file_location), "file location returned by"
153153
" urlretrieve is not a valid path")
154-
with open(file_location, encoding='utf-8') as f:
154+
with open(file_location, 'rb') as f:
155155
self.assertTrue(f.read(), "reading from the file location returned"
156156
" by urlretrieve failed")
157157

@@ -161,7 +161,7 @@ def test_specified_path(self):
161161
support.TESTFN) as (file_location, info):
162162
self.assertEqual(file_location, support.TESTFN)
163163
self.assertTrue(os.path.exists(file_location))
164-
with open(file_location, encoding='utf-8') as f:
164+
with open(file_location, 'rb') as f:
165165
self.assertTrue(f.read(), "reading from temporary file failed")
166166

167167
def test_header(self):
@@ -170,7 +170,7 @@ def test_header(self):
170170
self.assertIsInstance(info, email.message.Message,
171171
"info is not an instance of email.message.Message")
172172

173-
logo = "http://www.python.org/community/logos/python-logo-master-v3-TM.png"
173+
logo = "http://www.python.org/static/community_logos/python-logo-master-v3-TM.png"
174174

175175
def test_data_header(self):
176176
with self.urlretrieve(self.logo) as (file_location, fileheaders):

0 commit comments

Comments
 (0)