@@ -585,7 +585,7 @@ def _validate(self, *args, **kwargs):
585585 try :
586586 # TODO: we have lots the location by replacing it with a text
587587 location = add_unc (location )
588- with io . open (location , encoding = 'utf-8' , errors = 'replace' ) as txt :
588+ with open (location , encoding = 'utf-8' , errors = 'replace' ) as txt :
589589 text = txt .read ()
590590 self .value [path ] = text
591591 except Exception as e :
@@ -995,7 +995,7 @@ def load(self, location):
995995 errors = []
996996 try :
997997 loc = add_unc (loc )
998- with io . open (loc , encoding = 'utf-8' , errors = 'replace' ) as txt :
998+ with open (loc , encoding = 'utf-8' , errors = 'replace' ) as txt :
999999 input_text = txt .read ()
10001000 if not input_text :
10011001 msg = 'ABOUT file is empty: %(location)r'
@@ -1235,7 +1235,7 @@ def dump(self, location, lic_dict=None):
12351235 if on_windows :
12361236 about_file_path = add_unc (about_file_path )
12371237
1238- with io . open (about_file_path , mode = 'w' , encoding = 'utf-8' , errors = 'replace' ) as dumped :
1238+ with open (about_file_path , mode = 'w' , encoding = 'utf-8' , errors = 'replace' ) as dumped :
12391239 dumped .write (genereated_tk_version )
12401240 dumped .write (self .dumps (lic_dict ))
12411241
@@ -1246,7 +1246,7 @@ def dump_android_notice(self, path, context):
12461246 if on_windows :
12471247 path = add_unc (path )
12481248
1249- with io . open (path , mode = 'w' , encoding = 'utf-8' , errors = 'replace' ) as dumped :
1249+ with open (path , mode = 'w' , encoding = 'utf-8' , errors = 'replace' ) as dumped :
12501250 dumped .write (context )
12511251
12521252 def android_module_license (self , about_parent_path ):
@@ -1317,7 +1317,7 @@ def dump_lic(self, location, license_dict):
13171317 license_name , license_filename , license_context , license_url , spdx_license_key = license_dict [lic_key ]
13181318 license_info = (lic_key , license_name , license_filename , license_context , license_url , spdx_license_key )
13191319 license_key_name_context_url .append (license_info )
1320- with io . open (license_path , mode = 'w' , encoding = 'utf-8' , newline = '\n ' , errors = 'replace' ) as lic :
1320+ with open (license_path , mode = 'w' , encoding = 'utf-8' , newline = '\n ' , errors = 'replace' ) as lic :
13211321 lic .write (license_context )
13221322 else :
13231323 # Invalid license issue is already handled
@@ -1372,7 +1372,7 @@ def collect_abouts_license_expression(location):
13721372 for loc in about_locations :
13731373 try :
13741374 loc = add_unc (loc )
1375- with io . open (loc , encoding = 'utf-8' , errors = 'replace' ) as txt :
1375+ with open (loc , encoding = 'utf-8' , errors = 'replace' ) as txt :
13761376 input_text = txt .read ()
13771377 # saneyaml.load() will have parsing error if the input has
13781378 # tab value. Therefore, we should check if the input contains
@@ -1627,12 +1627,12 @@ def write_output(abouts, location, format): # NOQA
16271627 save_as_excel (location , about_dicts )
16281628
16291629def save_as_json (location , about_dicts ):
1630- with io . open (location , mode = 'w' ) as output_file :
1630+ with open (location , mode = 'w' ) as output_file :
16311631 data = util .format_about_dict_for_json_output (about_dicts )
16321632 output_file .write (json .dumps (data , indent = 2 ))
16331633
16341634def save_as_csv (location , about_dicts , field_names ):
1635- with io . open (location , mode = 'w' , encoding = 'utf-8' , newline = '' , errors = 'replace' ) as output_file :
1635+ with open (location , mode = 'w' , encoding = 'utf-8' , newline = '' , errors = 'replace' ) as output_file :
16361636 writer = csv .DictWriter (output_file , field_names )
16371637 writer .writeheader ()
16381638 csv_formatted_list = util .format_about_dict_output (about_dicts )
0 commit comments