Skip to content

Commit 44140ae

Browse files
committed
pylint solved
1 parent bfacb3c commit 44140ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

util/fof_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,11 +452,11 @@ def get_file_type(filename: str) -> FileType:
452452
return FileType.STATS
453453

454454
try:
455-
with open(filename, "r") as f:
455+
with open(filename, "r", encoding="utf-8") as f:
456456
first_line = f.readline()
457457
if "," in first_line or ";" in first_line:
458458
return FileType.STATS
459-
except Exception:
459+
except (OSError, FileNotFoundError):
460460
pass
461461

462462
raise ValueError(f"Unknown file type for '{filename}'")

0 commit comments

Comments
 (0)