mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
SF #1048865: Fix a trivial typo that breaks StreamReader.readlines()
This commit is contained in:
parent
a5c64599d5
commit
af5c7cff56
2 changed files with 13 additions and 2 deletions
|
@ -334,7 +334,7 @@ class StreamReader(Codec):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
data = self.read()
|
data = self.read()
|
||||||
return self.splitlines(keepends)
|
return data.splitlines(keepends)
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
|
|
||||||
|
|
|
@ -458,6 +458,16 @@ class CodecsModuleTest(unittest.TestCase):
|
||||||
self.assertEquals(codecs.encode(u'\xe4\xf6\xfc', 'latin-1'),
|
self.assertEquals(codecs.encode(u'\xe4\xf6\xfc', 'latin-1'),
|
||||||
'\xe4\xf6\xfc')
|
'\xe4\xf6\xfc')
|
||||||
|
|
||||||
|
class StreamReaderTest(unittest.TestCase):
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.reader = codecs.getreader('utf-8')
|
||||||
|
self.stream = StringIO.StringIO('\xed\x95\x9c\n\xea\xb8\x80')
|
||||||
|
|
||||||
|
def test_readlines(self):
|
||||||
|
f = self.reader(self.stream)
|
||||||
|
self.assertEquals(f.readlines(), [u'\ud55c\n', u'\uae00'])
|
||||||
|
|
||||||
def test_main():
|
def test_main():
|
||||||
test_support.run_unittest(
|
test_support.run_unittest(
|
||||||
UTF16Test,
|
UTF16Test,
|
||||||
|
@ -469,7 +479,8 @@ def test_main():
|
||||||
PunycodeTest,
|
PunycodeTest,
|
||||||
NameprepTest,
|
NameprepTest,
|
||||||
CodecTest,
|
CodecTest,
|
||||||
CodecsModuleTest
|
CodecsModuleTest,
|
||||||
|
StreamReaderTest
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue