Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9f2e46de
Commit
9f2e46de
authored
Jan 29, 2014
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #20424: Python implementation of io.StringIO now supports lone surrogates.
parents
61f56163
c92ea76f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
Lib/_pyio.py
Lib/_pyio.py
+1
-1
Lib/test/test_memoryio.py
Lib/test/test_memoryio.py
+9
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/_pyio.py
View file @
9f2e46de
...
...
@@ -2052,7 +2052,7 @@ class StringIO(TextIOWrapper):
def
__init__
(
self
,
initial_value
=
""
,
newline
=
"
\
n
"
):
super
(
StringIO
,
self
).
__init__
(
BytesIO
(),
encoding
=
"utf-8"
,
errors
=
"s
trict
"
,
errors
=
"s
urrogatepass
"
,
newline
=
newline
)
# Issue #5645: make universal newlines semantics the same as in the
# C version, even under Windows.
...
...
Lib/test/test_memoryio.py
View file @
9f2e46de
...
...
@@ -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.
...
...
Misc/NEWS
View file @
9f2e46de
...
...
@@ -13,6 +13,8 @@ Core and Builtins
Library
-------
- Issue #20424: Python implementation of io.StringIO now supports lone surrogates.
- Issue #20308: inspect.signature now works on classes without user-defined
__init__ or __new__ methods.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment