From 39c785108f1acddb70930edf023825f935aa640e Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 5 Oct 2001 21:22:21 +0000 Subject: Martijn Pieters convinced me that when readline() strips the trailing newline from a multifile part, it should also strip a trailing \r\n. --- Lib/multifile.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Lib/multifile.py b/Lib/multifile.py index 47e2346..ff7dbf6 100644 --- a/Lib/multifile.py +++ b/Lib/multifile.py @@ -76,8 +76,11 @@ class MultiFile: line = self.readahead if line: self.readahead = self._readline() - if not self.readahead and line[-1:] == "\n": - line = line[:-1] + if not self.readahead: + if line[-2:] == "\r\n": + line = line[:-2] + elif line[-1:] == "\n": + line = line[:-1] return line def _readline(self): -- cgit v0.12