Fix some problems introduced by the str8 repr change.

This commit is contained in:
Guido van Rossum 2007-06-15 03:35:38 +00:00
parent a092947d26
commit aa588c4699
3 changed files with 9 additions and 2 deletions

View file

@ -501,7 +501,8 @@ class Pickler:
else:
self.write(BINSTRING + pack("<i", n) + bytes(obj))
else:
self.write(STRING + bytes(repr(obj)) + b'\n')
# Strip leading 's' due to repr() of str8() returning s'...'
self.write(STRING + bytes(repr(obj).lstrip("s")) + b'\n')
self.memoize(obj)
dispatch[str8] = save_string