Commit 0d2c4425 authored by Carl Friedrich Bolz-Tereick's avatar Carl Friedrich Bolz-Tereick
Browse files

ouch: we were using the needlessly complicated search function when newline

translation is turned on

--HG--
branch : py3.7
parent 2047ab71c4da
......@@ -903,15 +903,14 @@ class W_TextIOWrapper(W_TextIOBase):
return space.newutf8(builder.build(), builder.getlength())
def _scan_line_ending(self, limit):
if self.readtranslate:
# Newlines are already translated, only search for \n
return self.decoded.find_char('\n', limit)
if self.readuniversal:
return self.decoded.find_newline_universal(limit)
else:
if self.readtranslate:
# Newlines are already translated, only search for \n
newline = '\n'
else:
# Non-universal mode.
newline = self.readnl
# Non-universal mode.
newline = self.readnl
if newline == '\r\n':
return self.decoded.find_crlf(limit)
else:
......
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