@@ -126,13 +126,13 @@ def verify_duplicate_name(self):
126126 field_name = p .field_name + p .group
127127 if field_name != '' and len (duplicates .intersection ([field_name ])) != 0 :
128128 fl_error = True
129- print ('Field at %s, %s, %s, %s have dublicate field_name' %
129+ print ('Field at %s, %s, %s, %s have duplicate field_name' %
130130 (p .field_name , p .efuse_block , p .bit_start , p .bit_count ))
131131 if fl_error is True :
132132 raise InputError ('Field names must be unique' )
133133
134134 def check_struct_field_name (self ):
135- # check that stuctured fields have a root field
135+ # check that structured fields have a root field
136136 for p in self :
137137 if '.' in p .field_name :
138138 name = ''
@@ -454,7 +454,7 @@ def process_input_file(file, type_table):
454454
455455def ckeck_md5_in_file (md5 , filename ):
456456 if os .path .exists (filename ):
457- with open (filename , 'r' ) as f :
457+ with open (filename , 'r' , encoding = 'utf-8' ) as f :
458458 for line in f :
459459 if md5 in line :
460460 return True
@@ -478,12 +478,12 @@ def create_output_files(name, output_table, debug):
478478 if ckeck_md5_in_file (output_table .md5_digest_table , file_c_path ) is False :
479479 status ('Creating efuse *.h file ' + file_h_path + ' ...' )
480480 output = output_table .to_header (file_name )
481- with open (file_h_path , 'w' ) as f :
481+ with open (file_h_path , 'w' , encoding = 'utf-8' ) as f :
482482 f .write (output )
483483
484484 status ('Creating efuse *.c file ' + file_c_path + ' ...' )
485485 output = output_table .to_c_file (file_name , debug )
486- with open (file_c_path , 'w' ) as f :
486+ with open (file_c_path , 'w' , encoding = 'utf-8' ) as f :
487487 f .write (output )
488488 else :
489489 print ('Source files do not require updating correspond to csv file.' )
0 commit comments