Skip to content

Commit

Permalink
encoding error on widows while reading files
Browse files Browse the repository at this point in the history
  • Loading branch information
abhimhamane committed Jan 17, 2024
1 parent 6f40378 commit a88db48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyshbundle/reader_replacer_csr.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def reader(file_name,line_num,degree,order,clm,slm,clm_std,slm_std,start_date,en
year_start (_type_): _description_
time_axes (_type_): _description_
"""
with gzip.open(file_name,"r") as file:
with gzip.open(file_name,"r", encoding='utf8') as file:
stuff = file.readlines()
stuff
for i in range (0,len(stuff),1):
Expand Down Expand Up @@ -172,7 +172,7 @@ def reader_replacer_csr(path, path_tn14, path_tn13):
# ''' Replace deg 2,3 '''
new_file_TN14 = path_tn14
rep_start_date, rep_end_date, c20, c30, c20_sigma, c30_sigma = [], [], [], [], [], []
with open(new_file_TN14,"r") as file:
with open(new_file_TN14,"r", encoding='utf8') as file:
stuff = file.readlines()
for i in range(0,len(stuff),1):
line_num = str('not found')
Expand Down Expand Up @@ -224,7 +224,7 @@ def reader_replacer_csr(path, path_tn14, path_tn13):
#''' Replace deg 1 '''
new_file_TN13 = path_tn13
rep_start_date_deg1, rep_end_date_deg1, c1m, s1m, c1m_sigma, s1m_sigma = [], [], [], [], [], []
with open(new_file_TN13,"r") as file:
with open(new_file_TN13,"r", encoding='utf8') as file:
stuff = file.readlines()
for i in range(0,len(stuff),1):
if stuff[i] == str('end of header ===============================================================================\n'):
Expand Down

0 comments on commit a88db48

Please sign in to comment.