LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File mod_python-3.5.0-006-8b4850d-req_args_none.patch of Package apache2-mod_python (Project home:aeneas_jaissle:sewikom)

From 8b4850d22e177a9f4d3586940c92bfeb7c96e1c1 Mon Sep 17 00:00:00 2001
From: Grisha Trubetskoy <grisha@modpython.org>
Date: Mon, 10 Mar 2014 21:05:42 -0400
Subject: [PATCH] Allow None as value for req.args. Patch submitted by Ron
 Gomes. Closes #29

---
 src/requestobject.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/requestobject.c b/src/requestobject.c
index 7569335..3683eb2 100644
--- a/src/requestobject.c
+++ b/src/requestobject.c
@@ -1967,6 +1967,10 @@ static int setreq_recmbr(requestobject *self, PyObject *val, void *name)
         return 0;
     }
     else if (strcmp(name, "args") == 0) {
+        if (val == Py_None) {
+            self->request_rec->args = 0;
+            return 0;
+        }
         MP_ANYSTR_AS_STR(v, val, 1);
         if (!v) {
             Py_DECREF(val); /* MP_ANYSTR_AS_STR */