diff options
| author | Guido van Rossum <guido@python.org> | 2007-07-19 22:19:35 +0000 |
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 2007-07-19 22:19:35 +0000 |
| commit | f93254d2992896445cbd1eec0ee4a80eb8edc6b8 (patch) | |
| tree | 72978d19d4170da77eb68d07ecff3833fb35e349 /Objects/bytesobject.c | |
| parent | 00058aa28c8215562995593c57ff9388e2bdb266 (diff) | |
| download | cpython-git-f93254d2992896445cbd1eec0ee4a80eb8edc6b8.tar.gz | |
Fix test_pickle, by reverting the string opcodes (S, T, U) to returning
strings, in Latin-1. Bytes are once more pickled through bytes.__reduce__,
but now it returns "latin-1" as the second parameter.
Unfortunately this breaks datetime pickling. I'll have to investigate
further; reverting Martin's changes doesn't seem to help.
Diffstat (limited to 'Objects/bytesobject.c')
| -rw-r--r-- | Objects/bytesobject.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 6340b46e84..ad5f4fe9f6 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -2724,13 +2724,11 @@ PyDoc_STRVAR(reduce_doc, "Return state information for pickling."); static PyObject * bytes_reduce(PyBytesObject *self) { - /* XXX: This currently returns a Py_UNICODE-widened string - in the tuple which is completely useless. Pickle stopped - using it for that reason. */ - return Py_BuildValue("(O(s#))", + return Py_BuildValue("(O(s#s))", self->ob_type, self->ob_bytes == NULL ? "" : self->ob_bytes, - self->ob_size); + self->ob_size, + "latin-1"); } static PySequenceMethods bytes_as_sequence = { |
