[Python-3000-checkins] r58860 - python/branches/py3k-pep3137/Lib/pickletools.py

christian.heimes python-3000-checkins at python.org
Mon Nov 5 16:45:56 CET 2007


Author: christian.heimes
Date: Mon Nov  5 16:45:56 2007
New Revision: 58860

Modified:
   python/branches/py3k-pep3137/Lib/pickletools.py
Log:
Fixed pickletools. Guess what was causing the trouble ... str(bytes()) again.

Modified: python/branches/py3k-pep3137/Lib/pickletools.py
==============================================================================
--- python/branches/py3k-pep3137/Lib/pickletools.py	(original)
+++ python/branches/py3k-pep3137/Lib/pickletools.py	Mon Nov  5 16:45:56 2007
@@ -311,7 +311,7 @@
             raise ValueError("no string quotes around %r" % data)
 
     if decode:
-        data = str(codecs.escape_decode(data)[0])
+        data = codecs.escape_decode(data)[0].decode("ascii")
     return data
 
 stringnl = ArgumentDescriptor(
@@ -325,7 +325,7 @@
                    """)
 
 def read_stringnl_noescape(f):
-    return read_stringnl(f, decode=False, stripquotes=False)
+    return read_stringnl(f, stripquotes=False)
 
 stringnl_noescape = ArgumentDescriptor(
                         name='stringnl_noescape',
@@ -1981,7 +1981,7 @@
 
 _dis_test = r"""
 >>> import pickle
->>> x = [1, 2, (3, 4), {str8(b'abc'): "def"}]
+>>> x = [1, 2, (3, 4), {bytes(b'abc'): "def"}]
 >>> pkl = pickle.dumps(x, 0)
 >>> dis(pkl)
     0: (    MARK


More information about the Python-3000-checkins mailing list