From: Guido van Rossum Date: Fri, 5 Oct 2001 21:22:21 +0000 (+0000) Subject: Martijn Pieters convinced me that when readline() strips the trailing X-Git-Tag: v2.2.1c1~1436 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=39c785108f1acddb70930edf023825f935aa640e;p=python Martijn Pieters convinced me that when readline() strips the trailing newline from a multifile part, it should also strip a trailing \r\n. --- diff --git a/Lib/multifile.py b/Lib/multifile.py index 47e2346978..ff7dbf6b14 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):