diff --git a/altamisa/isatab/parse_assay_study.py b/altamisa/isatab/parse_assay_study.py index 9947df6..a49ac97 100644 --- a/altamisa/isatab/parse_assay_study.py +++ b/altamisa/isatab/parse_assay_study.py @@ -768,6 +768,9 @@ def _read_next_line(self): self.unique_rows.add("\t".join(self._line)) except StopIteration: self._line = None + except UnicodeDecodeError as e: # pragma: no cover + msg = f"Invalid encoding of study file '{self._filename}' (use Unicode/UTF-8)." + raise ParseIsatabException(msg) from e return prev_line def read(self): @@ -888,6 +891,9 @@ def _read_next_line(self): self.unique_rows.add("\t".join(self._line)) except StopIteration: self._line = None + except UnicodeDecodeError as e: # pragma: no cover + msg = f"Invalid encoding of assay file '{self._filename}' (use Unicode/UTF-8)." + raise ParseIsatabException(msg) from e return prev_line def read(self): diff --git a/altamisa/isatab/parse_investigation.py b/altamisa/isatab/parse_investigation.py index 5ac8aff..a365cbf 100644 --- a/altamisa/isatab/parse_investigation.py +++ b/altamisa/isatab/parse_investigation.py @@ -132,6 +132,9 @@ def _read_next_line(self): self._line = list_strip(next(self._reader)) except StopIteration: self._line = None + except UnicodeDecodeError as e: # pragma: no cover + msg = f"Invalid encoding of investigation file '{self._filename}' (use Unicode/UTF-8)." + raise ParseIsatabException(msg) from e return prev_line def _next_line_startswith_comment(self):