mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
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.
This commit is contained in:
parent
cd3c26a717
commit
c5238b8288
2 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue