summaryrefslogtreecommitdiffstats
path: root/Lib/codecs.py
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2005-09-01 11:56:53 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2005-09-01 11:56:53 (GMT)
commitc5238b82887c9f0507632aec206739c3bb7a1caf (patch)
tree7e12c90828f3272e3ed0515a25745857f5c43945 /Lib/codecs.py
parentcd3c26a7171af2795df477598d045e46adf5d73b (diff)
downloadcpython-c5238b82887c9f0507632aec206739c3bb7a1caf.zip
cpython-c5238b82887c9f0507632aec206739c3bb7a1caf.tar.gz
cpython-c5238b82887c9f0507632aec206739c3bb7a1caf.tar.bz2
SF bug #1235646: codecs.StreamRecoder.next() now reencodes the data it reads
from the input stream, so that the output is a byte string in the correct encoding instead of a unicode string.
Diffstat (limited to 'Lib/codecs.py')
-rw-r--r--Lib/codecs.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/codecs.py b/Lib/codecs.py
index a964f99..d972a51 100644
--- a/Lib/codecs.py
+++ b/Lib/codecs.py
@@ -556,7 +556,9 @@ class StreamRecoder:
def next(self):
""" Return the next decoded line from the input stream."""
- return self.reader.next()
+ data = self.reader.next()
+ data, bytesencoded = self.encode(data, self.errors)
+ return data
def __iter__(self):
return self