From 08f37c71afeecab4259bf18deb13e6aa9da5ae1f Mon Sep 17 00:00:00 2001 From: Dmitry Malishev Date: Tue, 17 Oct 2023 14:02:23 +0300 Subject: [PATCH] Fix Parser to ignore encoding errors --- textract/parsers/txt_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/textract/parsers/txt_parser.py b/textract/parsers/txt_parser.py index 94cbe251..2152ab4f 100644 --- a/textract/parsers/txt_parser.py +++ b/textract/parsers/txt_parser.py @@ -5,5 +5,5 @@ class Parser(BaseParser): """Parse ``.txt`` files""" def extract(self, filename, **kwargs): - with open(filename) as stream: + with open(filename, errors='ignore') as stream: return stream.read()