@@ -106,7 +106,7 @@ def test_fileno(self):
106
106
# Make sure fd returned by fileno is valid.
107
107
with self .urlopen ("http://www.python.org/" , timeout = None ) as open_url :
108
108
fd = open_url .fileno ()
109
- with os .fdopen (fd , encoding = 'utf-8 ' ) as f :
109
+ with os .fdopen (fd , 'rb ' ) as f :
110
110
self .assertTrue (f .read (), "reading from file created using fd "
111
111
"returned by fileno failed" )
112
112
@@ -151,7 +151,7 @@ def test_basic(self):
151
151
with self .urlretrieve ("http://www.python.org/" ) as (file_location , info ):
152
152
self .assertTrue (os .path .exists (file_location ), "file location returned by"
153
153
" urlretrieve is not a valid path" )
154
- with open (file_location , encoding = 'utf-8 ' ) as f :
154
+ with open (file_location , 'rb ' ) as f :
155
155
self .assertTrue (f .read (), "reading from the file location returned"
156
156
" by urlretrieve failed" )
157
157
@@ -161,7 +161,7 @@ def test_specified_path(self):
161
161
support .TESTFN ) as (file_location , info ):
162
162
self .assertEqual (file_location , support .TESTFN )
163
163
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 :
165
165
self .assertTrue (f .read (), "reading from temporary file failed" )
166
166
167
167
def test_header (self ):
0 commit comments