@@ -34,7 +34,7 @@ def safeGetLine( lines, index ):
34
34
35
35
def safeReadFile ( path ):
36
36
try :
37
- return file ( path , 'rt' ).read ()
37
+ return open ( path , 'rt' , encoding = 'utf-8 ' ).read ()
38
38
except IOError as e :
39
39
return '<File "%s" is missing: %s>' % (path ,e )
40
40
@@ -77,13 +77,13 @@ def runAllTests( jsontest_executable_path, input_dir = None,
77
77
base_path = os .path .splitext (input_path )[0 ]
78
78
actual_output = safeReadFile ( base_path + '.actual' )
79
79
actual_rewrite_output = safeReadFile ( base_path + '.actual-rewrite' )
80
- file (base_path + '.process-output' ,'wt' ).write ( process_output )
80
+ open (base_path + '.process-output' , 'wt' , encoding = 'utf-8 ' ).write ( process_output )
81
81
if status :
82
82
print ('parsing failed' )
83
83
failed_tests .append ( (input_path , 'Parsing failed:\n ' + process_output ) )
84
84
else :
85
85
expected_output_path = os .path .splitext (input_path )[0 ] + '.expected'
86
- expected_output = file ( expected_output_path , 'rt' ).read ()
86
+ expected_output = open ( expected_output_path , 'rt' , encoding = 'utf-8 ' ).read ()
87
87
detail = ( compareOutputs ( expected_output , actual_output , 'input' )
88
88
or compareOutputs ( expected_output , actual_rewrite_output , 'rewrite' ) )
89
89
if detail :
0 commit comments