From: Guido van Rossum Date: Tue, 3 Jul 2007 20:30:03 +0000 (+0000) Subject: Fix the code for stripping the leading 's' from str8 and bytes literals. X-Git-Tag: v3.0a1~729 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1718fd1dc592de4f59206b1c69eb7ed45d92d818;p=python Fix the code for stripping the leading 's' from str8 and bytes literals. --- diff --git a/Modules/cPickle.c b/Modules/cPickle.c index 8aa6eaa7f8..d50c74358a 100644 --- a/Modules/cPickle.c +++ b/Modules/cPickle.c @@ -1086,8 +1086,10 @@ save_string(Picklerobject *self, PyObject *args, int doput) 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;