diff --git a/altamisa/isatab/parse_assay_study.py b/altamisa/isatab/parse_assay_study.py index 0a9c446..a49ac97 100644 --- a/altamisa/isatab/parse_assay_study.py +++ b/altamisa/isatab/parse_assay_study.py @@ -769,8 +769,7 @@ def _read_next_line(self): except StopIteration: self._line = None except UnicodeDecodeError as e: # pragma: no cover - tpl = "Invalid encoding after line {} of study file '{}' (use Unicode/UTF-8)." - msg = tpl.format(self._reader.line_num, self.filename) + msg = f"Invalid encoding of study file '{self._filename}' (use Unicode/UTF-8)." raise ParseIsatabException(msg) from e return prev_line @@ -893,8 +892,7 @@ def _read_next_line(self): except StopIteration: self._line = None except UnicodeDecodeError as e: # pragma: no cover - tpl = "Invalid encoding after line {} of assay file '{}' (use Unicode/UTF-8)." - msg = tpl.format(self._reader.line_num, self.filename) + msg = f"Invalid encoding of assay file '{self._filename}' (use Unicode/UTF-8)." raise ParseIsatabException(msg) from e return prev_line diff --git a/altamisa/isatab/parse_investigation.py b/altamisa/isatab/parse_investigation.py index 2db728e..a365cbf 100644 --- a/altamisa/isatab/parse_investigation.py +++ b/altamisa/isatab/parse_investigation.py @@ -133,8 +133,7 @@ def _read_next_line(self): except StopIteration: self._line = None except UnicodeDecodeError as e: # pragma: no cover - tpl = "Invalid encoding after line {} of investigation file '{}' (use Unicode/UTF-8)." - msg = tpl.format(self._reader.line_num, self._filename) + msg = f"Invalid encoding of investigation file '{self._filename}' (use Unicode/UTF-8)." raise ParseIsatabException(msg) from e return prev_line