From cf032db8785149689d94232b400e20e4d6336562 Mon Sep 17 00:00:00 2001 From: Matthias Baumgartner Date: Fri, 28 Jul 2023 12:00:11 +0200 Subject: minor style and text fixes --- bsie/reader/document/_plain.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bsie/reader/document/_plain.py') diff --git a/bsie/reader/document/_plain.py b/bsie/reader/document/_plain.py index a589265..8ea3c43 100644 --- a/bsie/reader/document/_plain.py +++ b/bsie/reader/document/_plain.py @@ -20,6 +20,7 @@ __all__: typing.Sequence[str] = ( ## code ## class Plain(base.Reader): + """Read paragraphs (seperated by newline) from a plain text file.""" _match: filematcher.Matcher @@ -32,7 +33,7 @@ class Plain(base.Reader): raise errors.UnsupportedFileFormatError(path) # open file in text mode - with open(path, 'rt') as ifile: + with open(path, 'rt', encoding='UTF-8') as ifile: return [line.strip() for line in ifile.read().split('\n') if len(line.strip()) > 0] ## EOF ## -- cgit v1.2.3