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
db8d6265
Commit
db8d6265
authored
Oct 04, 2016
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #28321: Fixed writing non-BMP characters with binary format in plistlib.
parents
27b40981
7338ebc4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
Lib/plistlib.py
Lib/plistlib.py
+1
-1
Lib/test/test_plistlib.py
Lib/test/test_plistlib.py
+7
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/plistlib.py
View file @
db8d6265
...
...
@@ -918,7 +918,7 @@ class _BinaryPlistWriter (object):
self
.
_write_size
(
0x50
,
len
(
value
))
except
UnicodeEncodeError
:
t
=
value
.
encode
(
'utf-16be'
)
self
.
_write_size
(
0x60
,
len
(
value
)
)
self
.
_write_size
(
0x60
,
len
(
t
)
//
2
)
self
.
_fp
.
write
(
t
)
...
...
Lib/test/test_plistlib.py
View file @
db8d6265
...
...
@@ -360,6 +360,13 @@ class TestPlistlib(unittest.TestCase):
plistlib
.
dumps
,
testString
)
def
test_non_bmp_characters
(
self
):
pl
=
{
'python'
:
'
\
U0001f40d
'
}
for
fmt
in
ALL_FORMATS
:
with
self
.
subTest
(
fmt
=
fmt
):
data
=
plistlib
.
dumps
(
pl
,
fmt
=
fmt
)
self
.
assertEqual
(
plistlib
.
loads
(
data
),
pl
)
def
test_nondictroot
(
self
):
for
fmt
in
ALL_FORMATS
:
with
self
.
subTest
(
fmt
=
fmt
):
...
...
Misc/NEWS
View file @
db8d6265
...
...
@@ -50,6 +50,8 @@ Core and Builtins
Library
-------
- Issue #28321: Fixed writing non-BMP characters with binary format in plistlib.
- Issue #28225: bz2 module now supports pathlib. Initial patch by Ethan Furman.
- Issue #28227: gzip now supports pathlib. Patch by Ethan Furman.
...
...
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