diff options
author | Walter Dörwald <walter@livinglogic.de> | 2007-06-12 16:40:17 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2007-06-12 16:40:17 (GMT) |
commit | 42748a8d6dc121d5311668a0fe005c277b7d0220 (patch) | |
tree | 7c463d2780b8e6683e21848efac677f19daa30cb /Lib/pickletools.py | |
parent | 6e8fcae38f119b95be0c707b7a44db209c485c84 (diff) | |
download | cpython-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/pickletools.py')
-rw-r--r-- | Lib/pickletools.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/pickletools.py b/Lib/pickletools.py index 000fc6b..23c186a 100644 --- a/Lib/pickletools.py +++ b/Lib/pickletools.py @@ -10,6 +10,8 @@ dis(pickle, out=None, memo=None, indentlevel=4) Print a symbolic disassembly of a pickle. ''' +import codecs + __all__ = ['dis', 'genops', ] @@ -318,10 +320,8 @@ def read_stringnl(f, decode=True, stripquotes=True): else: raise ValueError("no string quotes around %r" % data) - # I'm not sure when 'string_escape' was added to the std codecs; it's - # crazy not to use it if it's there. if decode: - data = data.decode('string_escape') + data = codecs.escape_decode(data)[0] return data stringnl = ArgumentDescriptor( |