Commit a6e436e4 authored by Gustavo Niemeyer's avatar Gustavo Niemeyer

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

  as parameter.
parent 238b267b
......@@ -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
-------
......
......@@ -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,
......
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