The incremental decoder for utf-7 must preserve its state between calls.
Solves issue1460.

Might not be a backport candidate: a new API function was added,
and some code may rely on details in utf-7.py.
diff --git a/Modules/_codecsmodule.c b/Modules/_codecsmodule.c
index 0716f3a..d4eb0d5 100644
--- a/Modules/_codecsmodule.c
+++ b/Modules/_codecsmodule.c
@@ -230,18 +230,25 @@
 
 static PyObject *
 utf_7_decode(PyObject *self,
-	    PyObject *args)
+             PyObject *args)
 {
     const char *data;
     Py_ssize_t size;
     const char *errors = NULL;
+    int final = 0;
+    Py_ssize_t consumed;
+    PyObject *decoded = NULL;
 
-    if (!PyArg_ParseTuple(args, "t#|z:utf_7_decode",
-			  &data, &size, &errors))
-	return NULL;
+    if (!PyArg_ParseTuple(args, "t#|zi:utf_7_decode",
+                          &data, &size, &errors, &final))
+        return NULL;
+    consumed = size;
 
-    return codec_tuple(PyUnicode_DecodeUTF7(data, size, errors),
-		       size);
+    decoded = PyUnicode_DecodeUTF7Stateful(data, size, errors,
+                                           final ? NULL : &consumed);
+    if (decoded == NULL)
+        return NULL;
+    return codec_tuple(decoded, consumed);
 }
 
 static PyObject *