File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
src/clusterfuzz/_internal Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,10 @@ def do_GET(self): # pylint: disable=invalid-name
101101 return
102102
103103 try :
104- with open (absolute_path ) as file_handle :
104+ # It is necessary to open the file as binary because `self.wfile` is now
105+ # an `io.BufferedIOBase` since python3.6, and thus expects binary input
106+ # in the `self.wfile.write` call below.
107+ with open (absolute_path , 'rb' ) as file_handle :
105108 data = file_handle .read ()
106109 except OSError :
107110 self .send_response (403 )
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ def __init__(self):
3232 self .contents = ''
3333
3434 def write (self , data ):
35- self .contents += data
35+ # Since the fake files are being created with simple contents, we can
36+ # just decode that as 'utf-8'.
37+ self .contents += data .decode ("utf-8" )
3638
3739 def __init__ (self , path ): # pylint: disable=super-init-not-called
3840 self .response_code = 0
You can’t perform that action at this time.
0 commit comments