From 175c0a285c0eba508fd4b93b3d858e73985339e6 Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 24 Feb 2020 15:24:39 +0000 Subject: open possibly-utf8 files with forced utf8 --- src/utils/parse/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/utils/parse') diff --git a/src/utils/parse/__init__.py b/src/utils/parse/__init__.py index 28f074c2..262edf4a 100644 --- a/src/utils/parse/__init__.py +++ b/src/utils/parse/__init__.py @@ -1,5 +1,5 @@ -import decimal, io, re, typing -from src.utils import datetime, errors +import decimal, re, typing +from src.utils import datetime, errors, io from .spec import * from .time import duration @@ -10,7 +10,7 @@ COMMENT_TYPES = ["#", "//"] def hashflags(filename: str ) -> typing.List[typing.Tuple[str, typing.Optional[str]]]: hashflags = [] # type: typing.List[typing.Tuple[str, typing.Optional[str]]] - with io.open(filename, mode="r", encoding="utf8") as f: + with io.open(filename, "r") as f: for line in f: line = line.strip("\n") found = False -- cgit v1.3.1-10-gc9f91