diff options
author | Marc-André Lemburg <mal@egenix.com> | 2004-02-26 15:22:17 (GMT) |
---|---|---|
committer | Marc-André Lemburg <mal@egenix.com> | 2004-02-26 15:22:17 (GMT) |
commit | d594849c42b6141622f8e442e26b49e2df6ef4ff (patch) | |
tree | 920329f741ce0da15b22d4437580194f84b176d1 /Lib/codecs.py | |
parent | 6bee23cdc3e1b776ccee082b69cf85099aabca6e (diff) | |
download | cpython-d594849c42b6141622f8e442e26b49e2df6ef4ff.zip cpython-d594849c42b6141622f8e442e26b49e2df6ef4ff.tar.gz cpython-d594849c42b6141622f8e442e26b49e2df6ef4ff.tar.bz2 |
Ignore sizehint argument. Fixes SF #844561.
Diffstat (limited to 'Lib/codecs.py')
-rw-r--r-- | Lib/codecs.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/Lib/codecs.py b/Lib/codecs.py index 061bc1c..92c6fef 100644 --- a/Lib/codecs.py +++ b/Lib/codecs.py @@ -303,14 +303,11 @@ class StreamReader(Codec): Line breaks are implemented using the codec's decoder method and are included in the list entries. - sizehint, if given, is passed as size argument to the - stream's .read() method. + sizehint, if given, is ignored since there is no efficient + way to finding the true end-of-line. """ - if sizehint is None: - data = self.stream.read() - else: - data = self.stream.read(sizehint) + data = self.stream.read() return self.decode(data, self.errors)[0].splitlines(1) def reset(self): @@ -488,10 +485,7 @@ class StreamRecoder: def readlines(self, sizehint=None): - if sizehint is None: - data = self.reader.read() - else: - data = self.reader.read(sizehint) + data = self.reader.read() data, bytesencoded = self.encode(data, self.errors) return data.splitlines(1) |