From 77610b180ef311e6dc5281f41fe0464d57ba5432 Mon Sep 17 00:00:00 2001 From: Arg0s1080 Date: Fri, 3 May 2019 14:38:05 +0200 Subject: [PATCH] fix unittest detected errors: strip "<" (left abd right) in alphanum fields (document_number & optional_data & optional_data_2) --- mrz/checker/_fields.py | 4 ++-- mrz/checker/td1.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mrz/checker/_fields.py b/mrz/checker/_fields.py index dba4e56..2416f2a 100755 --- a/mrz/checker/_fields.py +++ b/mrz/checker/_fields.py @@ -239,8 +239,8 @@ def _str_common_fields(self): self._expiry_date, self._sex, self._document_type.rstrip("<"), - self._document_number.rstrip("<"), - self._optional_data.rstrip("<")) + self._document_number.strip("<"), + self._optional_data.strip("<")) names = ("surname name country nationality birth_date expiry_date sex " "document_type document_number optional_data ") return fields, names diff --git a/mrz/checker/td1.py b/mrz/checker/td1.py index 679fe38..fea4f54 100755 --- a/mrz/checker/td1.py +++ b/mrz/checker/td1.py @@ -125,7 +125,7 @@ def fields(self): optional_data_2 and final_hash """ - extra_fields = self._optional_data_2.rstrip("<"), self._final_hash + extra_fields = self._optional_data_2.strip("<"), self._final_hash extra_names = "optional_data_2 final_hash" return namedtuple_maker(self._str_common_fields(), self._str_common_hashes(), extra_fields, extra_names)