Kaydet (Commit) 39c78510 authored tarafından Guido van Rossum's avatar Guido van Rossum

Martijn Pieters convinced me that when readline() strips the trailing

newline from a multifile part, it should also strip a trailing \r\n.
üst 9475a231
...@@ -76,8 +76,11 @@ class MultiFile: ...@@ -76,8 +76,11 @@ class MultiFile:
line = self.readahead line = self.readahead
if line: if line:
self.readahead = self._readline() self.readahead = self._readline()
if not self.readahead and line[-1:] == "\n": if not self.readahead:
line = line[:-1] if line[-2:] == "\r\n":
line = line[:-2]
elif line[-1:] == "\n":
line = line[:-1]
return line return line
def _readline(self): def _readline(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment