summaryrefslogtreecommitdiffstats
path: root/Lib/pickle.py
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2007-06-12 16:40:17 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2007-06-12 16:40:17 (GMT)
commit42748a8d6dc121d5311668a0fe005c277b7d0220 (patch)
tree7c463d2780b8e6683e21848efac677f19daa30cb /Lib/pickle.py
parent6e8fcae38f119b95be0c707b7a44db209c485c84 (diff)
downloadcpython-42748a8d6dc121d5311668a0fe005c277b7d0220.zip
cpython-42748a8d6dc121d5311668a0fe005c277b7d0220.tar.gz
cpython-42748a8d6dc121d5311668a0fe005c277b7d0220.tar.bz2
Rip out all codecs that can't work in a unicode/bytes world:
base64, uu, zlib, rot_13, hex, quopri, bz2, string_escape. However codecs.escape_encode() and codecs.escape_decode() still exist, as they are used for pickling str8 objects (so those two functions can go, when the str8 type is removed).
Diffstat (limited to 'Lib/pickle.py')
-rw-r--r--Lib/pickle.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py
index b950717..9919aa4 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -34,6 +34,7 @@ import sys
import struct
import re
import io
+import codecs
__all__ = ["PickleError", "PicklingError", "UnpicklingError", "Pickler",
"Unpickler", "dump", "dumps", "load", "loads"]
@@ -929,7 +930,7 @@ class Unpickler:
break
else:
raise ValueError, "insecure string pickle"
- self.append(str8(rep.decode("string-escape")))
+ self.append(str8(codecs.escape_decode(rep)[0]))
dispatch[STRING[0]] = load_string
def load_binstring(self):