- Fixed #853061: allow BZ2Compressor.compress() to receive an empty string

as parameter.
This commit is contained in:
Gustavo Niemeyer 2004-02-14 00:02:45 +00:00
parent 238b267bf6
commit a6e436e4b4
2 changed files with 6 additions and 0 deletions

View File

@ -226,6 +226,9 @@ Extension modules
- itertools.izip() with no arguments now returns an empty iterator instead
of raising a TypeError exception.
- Fixed #853061: allow BZ2Compressor.compress() to receive an empty string
as parameter.
Library
-------

View File

@ -1503,6 +1503,9 @@ BZ2Comp_compress(BZ2CompObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s#", &data, &datasize))
return NULL;
if (datasize == 0)
return PyString_FromString("");
ACQUIRE_LOCK(self);
if (!self->running) {
PyErr_SetString(PyExc_ValueError,