A new user interface for you! Read more...

File mod_python-3.5.0-016-8da41b9-dbm_psp.patch of Package apache2-mod_python

From e61cf82977c1670365eff1cbfe7b24b75238037b Mon Sep 17 00:00:00 2001
From: estrand2020 <estrand@datatope.com>
Date: Mon, 30 Nov 2015 22:19:42 -0800
Subject: [PATCH 1/3] fixed bug with dbm_cleanup using same variable name for
 db interface and filename

---
 lib/python/mod_python/Session.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/python/mod_python/Session.py b/lib/python/mod_python/Session.py
index 38694c2..00b4aef 100644
--- a/lib/python/mod_python/Session.py
+++ b/lib/python/mod_python/Session.py
@@ -338,9 +338,9 @@ def unlock_session_cleanup(sess):
 ## DbmSession
 
 def dbm_cleanup(data):
-    dbm, server = data
+    filename, server = data
     _apache._global_lock(server, None, 0)
-    db = dbm.open(dbm, 'c')
+    db = dbm.open(filename, 'c')
     try:
         old = []
         s = db.first()

From 87417aa088c99efbe4beadf8323fa4d4302abc3c Mon Sep 17 00:00:00 2001
From: estrand2020 <estrand@datatope.com>
Date: Mon, 30 Nov 2015 22:57:50 -0800
Subject: [PATCH 2/3] check major python version so that a PSP execution
 exception is re-raised with traceback correctly

---
 lib/python/mod_python/psp.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/python/mod_python/psp.py b/lib/python/mod_python/psp.py
index f994847..4ef8433 100644
--- a/lib/python/mod_python/psp.py
+++ b/lib/python/mod_python/psp.py
@@ -29,6 +29,8 @@
 import dbm, dbm
 import tempfile
 
+PY2 = sys.version[0] == '2'
+
 # dbm types for cache
 dbm_types = {}
 
@@ -268,7 +270,10 @@ def __init__(self, label, file, cache):
                     # run error page
                     psp.error_page.run({"exception": (et, ev, etb)}, flush)
                 else:
-                    raise et(ev).with_traceback(etb)
+                    if PY2:
+                        raise et, ev, etb
+                    else:
+                        raise et(ev).with_traceback(etb)
         finally:
             # if session was created here, unlock it and don't leave
             # it behind in request object in unlocked state as it

From 11c300610e644bcd3353c66bfa856c498fdbbfcd Mon Sep 17 00:00:00 2001
From: estrand2020 <estrand@datatope.com>
Date: Mon, 30 Nov 2015 23:14:28 -0800
Subject: [PATCH 3/3] use connection.client_ip instead of connection.remote_ip
 to prevent clogging of the apache error log with deprecation warnings

---
 lib/python/mod_python/Session.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/python/mod_python/Session.py b/lib/python/mod_python/Session.py
index 00b4aef..40b2b53 100644
--- a/lib/python/mod_python/Session.py
+++ b/lib/python/mod_python/Session.py
@@ -124,7 +124,7 @@ def _new_sid(req):
     g = _get_generator()
     rnd1 = g.randint(0, 999999999)
     rnd2 = g.randint(0, 999999999)
-    ip = req.connection.remote_ip
+    ip = req.connection.client_ip
 
     return md5_hash("%d%d%d%d%s" % (t, pid, rnd1, rnd2, ip))