Roundup Tracker - Issues

Message5706

Author rouilj
Recipients ber, grisha, jerrykan, rouilj
Date 2016-07-02.17:49:24
Message-id <1467481765.04.0.790847813218.issue2550821@psf.upfronthosting.co.za>
In-reply-to
See also: https://github.com/grisha/mod_python/issues/13

Also:

  http://modpython.org/live/current/doc-html/pythonapi.html


I propose this fix:

    # Release 3.4 of mod_python uses add_cgi_vars() and depricates
    # add_common_vars. So try to use the add_cgi_vars and if it fails
    # with AttributeError because we are running an older mod_apache without
    # that function, fallback to add_common_vars.
    try:
        req.add_cgi_vars()
    except AttributeError:
        req.add_common_vars()

so we try to call only add_cgi_vars() which is the current preferred
method. If it fails because the function doesn't exist it should
raise and AttributeError at which point we call the older add_common_vars.

Bern, does this look reasonable?

I don't have a suitable apache/mod_python environment to test,
but this sees pretty safe and matches recommendations from mod_python.

-- rouilj
History
Date User Action Args
2016-07-02 17:49:25rouiljsetmessageid: <1467481765.04.0.790847813218.issue2550821@psf.upfronthosting.co.za>
2016-07-02 17:49:25rouiljsetrecipients: + rouilj, ber, jerrykan, grisha
2016-07-02 17:49:25rouiljlinkissue2550821 messages
2016-07-02 17:49:24rouiljcreate