Skip to content

Commit 0696f6d

Browse files
committed
mod_python update/deprication.
issue2550821 - mod_python 3.4.1 - add_cgi_vars() instead of add_common_vars() issue2551005 - mod_python discontinued
1 parent f3e83c8 commit 0696f6d

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

roundup/cgi/apache.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
# This module operates with only one tracker
1111
# and must be placed in the tracker directory.
1212
#
13+
# mod_python is deplricated and not well tested with release 2.0 of
14+
# roundup. mod_wsgi is the preferred interface. It amy not work
15+
# with python3.
16+
17+
# The patch from https://issues.roundup-tracker.org/issue2550821
18+
# is included. Look for this url below. It is not tested, but
19+
# we assume it's safe and syntax it seems ok.
1320

1421
import cgi
1522
import os
@@ -119,7 +126,17 @@ def handler(req):
119126
__tracker_cache_lock.release()
120127
# create environment
121128
# Note: cookies are read from HTTP variables, so we need all HTTP vars
122-
req.add_common_vars()
129+
130+
# https://issues.roundup-tracker.org/issue2550821
131+
# Release 3.4 of mod_python uses add_cgi_vars() and depricates
132+
# add_common_vars. So try to use the add_cgi_vars and if it fails
133+
# with AttributeError because we are running an older mod_apache without
134+
# that function, fallback to add_common_vars.
135+
try:
136+
req.add_cgi_vars()
137+
except AttributeError:
138+
req.add_common_vars()
139+
123140
_env = dict(req.subprocess_env)
124141
# XXX classname must be the first item in PATH_INFO. roundup.cgi does:
125142
# path = os.environ.get('PATH_INFO', '/').split('/')

0 commit comments

Comments
 (0)