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;
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to