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.
This commit is contained in:
parent
62b44be0d5
commit
7969e38872
1 changed files with 1 additions and 0 deletions
|
@ -119,6 +119,7 @@ def input(
|
||||||
|
|
||||||
elif read_files and os.path.isfile(arg):
|
elif read_files and os.path.isfile(arg):
|
||||||
lines = open(arg, 'r', encoding='utf-8')
|
lines = open(arg, 'r', encoding='utf-8')
|
||||||
|
lines = (line.rstrip('\r\n') for line in lines)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
lines = arg.splitlines()
|
lines = arg.splitlines()
|
||||||
|
|
Loading…
Reference in a new issue