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
8b74b15b
Commit
8b74b15b
authored
Dec 19, 2000
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test some Unicode pickling endcases.
parent
a31b4ef7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
Lib/test/test_pickle.py
Lib/test/test_pickle.py
+12
-0
No files found.
Lib/test/test_pickle.py
View file @
8b74b15b
...
...
@@ -138,6 +138,18 @@ def dotest(pickle):
else
:
print
"accepted insecure string: %s"
%
repr
(
buf
)
# Test some Unicode end cases
endcases
=
[
u''
,
u'<
\
\
u>'
,
u'<
\
\
\
u1234
>'
,
u'<
\
n
>'
,
u'<
\
\
>'
]
for
u
in
endcases
:
try
:
u2
=
pickle
.
loads
(
pickle
.
dumps
(
u
))
except
Exception
,
msg
:
print
"Endcase exception: %s => %s(%s)"
%
\
(
`u`
,
msg
.
__class__
.
__name__
,
str
(
msg
))
else
:
if
u2
!=
u
:
print
"Endcase failure: %s => %s"
%
(
`u`
,
`u2`
)
import
pickle
dotest
(
pickle
)
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