[Python-3000-checkins] r56166 - python/branches/py3k-struni/Modules/cPickle.c

guido.van.rossum python-3000-checkins at python.org
Tue Jul 3 22:30:03 CEST 2007


Author: guido.van.rossum
Date: Tue Jul  3 22:30:03 2007
New Revision: 56166

Modified:
   python/branches/py3k-struni/Modules/cPickle.c
Log:
Fix the code for stripping the leading 's' from str8 and bytes literals.


Modified: python/branches/py3k-struni/Modules/cPickle.c
==============================================================================
--- python/branches/py3k-struni/Modules/cPickle.c	(original)
+++ python/branches/py3k-struni/Modules/cPickle.c	Tue Jul  3 22:30:03 2007
@@ -1086,8 +1086,10 @@
 		repr_str = PyString_AS_STRING((PyStringObject *)repr);
 
                 /* Strip leading 's' due to repr() of str8() returning s'...' */
-                if (repr_str[0] == 's')
+                if (repr_str[0] == 's') {
 			repr_str++;
+			len--;
+		}
 
 		if (self->write_func(self, &string, 1) < 0)
 			goto err;


More information about the Python-3000-checkins mailing list