From 7969e3887269b5523129668834cc34bd2c2f0c5d Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 7 Dec 2020 20:23:14 -0800 Subject: [PATCH] Remove trailing newlines from lines read from files. The other forms of pipeable.input don't include trailing newlines, so this makes read_files more consistent with the rest. --- voussoirkit/pipeable.py | 1 + 1 file changed, 1 insertion(+) diff --git a/voussoirkit/pipeable.py b/voussoirkit/pipeable.py index 8d22afe..54a4ee1 100644 --- a/voussoirkit/pipeable.py +++ b/voussoirkit/pipeable.py @@ -119,6 +119,7 @@ def input( elif read_files and os.path.isfile(arg): lines = open(arg, 'r', encoding='utf-8') + lines = (line.rstrip('\r\n') for line in lines) else: lines = arg.splitlines()