Commit 8b74b15b authored by Guido van Rossum's avatar Guido van Rossum

Test some Unicode pickling endcases.

parent a31b4ef7
......@@ -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)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment