Commit 1718fd1d authored by Guido van Rossum's avatar Guido van Rossum

Fix the code for stripping the leading 's' from str8 and bytes literals.

parent 07d4e78b
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment