diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2000-12-10 15:12:14 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2000-12-10 15:12:14 (GMT) |
commit | c6c283840316dec54244b311657511e95e742eb0 (patch) | |
tree | 8a69fbaa6bee27bd54ab2abdc1a85cbfd3eb4ea2 /Lib | |
parent | 2f1aeb950d8b22330f1751e7a0f80c9621e9b1a8 (diff) | |
download | cpython-c6c283840316dec54244b311657511e95e742eb0.zip cpython-c6c283840316dec54244b311657511e95e742eb0.tar.gz cpython-c6c283840316dec54244b311657511e95e742eb0.tar.bz2 |
(Patch #102698) Fix for a bug reported by Wade Leftwich:
StreamReader ignores the 'errors' parameter passed to its constructor
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/codecs.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/codecs.py b/Lib/codecs.py index 56b6dcf..fca0f8e 100644 --- a/Lib/codecs.py +++ b/Lib/codecs.py @@ -205,7 +205,7 @@ class StreamReader(Codec): """ # Unsliced reading: if size < 0: - return self.decode(self.stream.read())[0] + return self.decode(self.stream.read(), self.errors)[0] # Sliced reading: read = self.stream.read @@ -214,7 +214,7 @@ class StreamReader(Codec): i = 0 while 1: try: - object, decodedbytes = decode(data) + object, decodedbytes = decode(data, self.errors) except ValueError,why: # This method is slow but should work under pretty much # all conditions; at most 10 tries are made @@ -247,7 +247,7 @@ class StreamReader(Codec): line = self.stream.readline() else: line = self.stream.readline(size) - return self.decode(line)[0] + return self.decode(line,self.errors)[0] def readlines(self, sizehint=0): @@ -266,7 +266,7 @@ class StreamReader(Codec): data = self.stream.read() else: data = self.stream.read(sizehint) - return self.decode(data)[0].splitlines(1) + return self.decode(data,self.errors)[0].splitlines(1) def reset(self): |