summaryrefslogtreecommitdiffstats
path: root/Lib/pickletools.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-04-13 11:09:22 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-04-13 11:09:22 (GMT)
commitf7351b40b54b3354c4a8b01d9072b888256fca87 (patch)
treef52f592075724b0a8719ebbd9a00cd0b8bc3f0ea /Lib/pickletools.py
parent1bc6f6ea5e2e2f81922174a96ec7ce759ac8dc8c (diff)
downloadcpython-f7351b40b54b3354c4a8b01d9072b888256fca87.zip
cpython-f7351b40b54b3354c4a8b01d9072b888256fca87.tar.gz
cpython-f7351b40b54b3354c4a8b01d9072b888256fca87.tar.bz2
Merged revisions 80031 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r80031 | victor.stinner | 2010-04-13 13:07:24 +0200 (mar., 13 avril 2010) | 4 lines Issue #8383: pickle and pickletools use surrogatepass error handler when encoding unicode as utf8 to support lone surrogates and stay compatible with Python 2.x and 3.0 ........
Diffstat (limited to 'Lib/pickletools.py')
-rw-r--r--Lib/pickletools.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/pickletools.py b/Lib/pickletools.py
index ca11aa3..6ab75c7 100644
--- a/Lib/pickletools.py
+++ b/Lib/pickletools.py
@@ -469,7 +469,7 @@ def read_unicodestring4(f):
raise ValueError("unicodestring4 byte count < 0: %d" % n)
data = f.read(n)
if len(data) == n:
- return str(data, 'utf-8')
+ return str(data, 'utf-8', 'surrogatepass')
raise ValueError("expected %d bytes in a unicodestring4, but only %d "
"remain" % (n, len(data)))