mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Ignore sizehint argument. Fixes SF #844561.
This commit is contained in:
parent
6bee23cdc3
commit
d594849c42
1 changed files with 4 additions and 10 deletions
|
@ -303,14 +303,11 @@ class StreamReader(Codec):
|
||||||
Line breaks are implemented using the codec's decoder
|
Line breaks are implemented using the codec's decoder
|
||||||
method and are included in the list entries.
|
method and are included in the list entries.
|
||||||
|
|
||||||
sizehint, if given, is passed as size argument to the
|
sizehint, if given, is ignored since there is no efficient
|
||||||
stream's .read() method.
|
way to finding the true end-of-line.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if sizehint is None:
|
data = self.stream.read()
|
||||||
data = self.stream.read()
|
|
||||||
else:
|
|
||||||
data = self.stream.read(sizehint)
|
|
||||||
return self.decode(data, self.errors)[0].splitlines(1)
|
return self.decode(data, self.errors)[0].splitlines(1)
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
|
@ -488,10 +485,7 @@ class StreamRecoder:
|
||||||
|
|
||||||
def readlines(self, sizehint=None):
|
def readlines(self, sizehint=None):
|
||||||
|
|
||||||
if sizehint is None:
|
data = self.reader.read()
|
||||||
data = self.reader.read()
|
|
||||||
else:
|
|
||||||
data = self.reader.read(sizehint)
|
|
||||||
data, bytesencoded = self.encode(data, self.errors)
|
data, bytesencoded = self.encode(data, self.errors)
|
||||||
return data.splitlines(1)
|
return data.splitlines(1)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue