=== modified file 'twisted/protocols/_c_urlarg.c'
--- twisted/protocols/_c_urlarg.c	2004-08-25 09:02:51 +0000
+++ twisted/protocols/_c_urlarg.c	2009-12-09 04:19:49 +0000
@@ -47,6 +47,9 @@
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#|c:unquote", kwlist, &s, &length, &escchar)) {
         return NULL;
     }
+    if (length == 0) {
+        return PyString_FromStringAndSize("", 0);
+    }
     /* output = cStringIO() */
     output = PycStringIO->NewOutput(length);
     if (output == NULL) {

