Skip to content

Commit

Permalink
cloase file properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Griesfeller committed Apr 15, 2024
1 parent 33a1367 commit 8941e59
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pyaro_readers/nilupmfebas/ebas_nasa_ames.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
For details on the file format see `here <https://ebas-submit.nilu.no/
Submit-Data/Getting-started>`__
"""

import csv
import logging
import os
Expand Down Expand Up @@ -636,10 +637,12 @@ def read_file(
data = []
self.file = nasa_ames_file
try:
lines = open(self.file).readlines()
with open(self.file) as fh:
lines = fh.readlines()
except UnicodeDecodeError:
try:
lines = open(self.file, encoding="latin_1").readlines()
with open(self.file, encoding="latin_1") as fh:
lines = fh.readlines()
except UnicodeDecodeError:
return

Expand Down

0 comments on commit 8941e59

Please sign in to comment.