mirror of
https://github.com/python/cpython.git
synced 2025-10-08 08:01:55 +00:00
Issue #20424: Python implementation of io.StringIO now supports lone surrogates.
This commit is contained in:
parent
1e40295af6
commit
c92ea76f3f
3 changed files with 12 additions and 1 deletions
|
@ -609,6 +609,15 @@ class PyStringIOTest(MemoryTestMixin, MemorySeekTestMixin,
|
|||
UnsupportedOperation = pyio.UnsupportedOperation
|
||||
EOF = ""
|
||||
|
||||
def test_lone_surrogates(self):
|
||||
# Issue #20424
|
||||
memio = self.ioclass('\ud800')
|
||||
self.assertEqual(memio.read(), '\ud800')
|
||||
|
||||
memio = self.ioclass()
|
||||
memio.write('\ud800')
|
||||
self.assertEqual(memio.getvalue(), '\ud800')
|
||||
|
||||
|
||||
class PyStringIOPickleTest(TextIOTestMixin, unittest.TestCase):
|
||||
"""Test if pickle restores properly the internal state of StringIO.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue