Opened 18 years ago

Closed 18 years ago

#1497 closed defect (invalid)

Django mod_python handler fails with older python 2.3

Reported by: nick.phillips@… Owned by: Adrian Holovaty
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Due to what appears to be a bug in os.py in the version of python 2.3 shipped in Debian (Debian package version 2.3.5-2), Django's mod_python handler fails (in class ModPythonHandler's __call__ method):

        os.environ.update(req.subprocess_env)

Newer versions of os.py have updated the way that os.environ.update handles non-dict arguments -- it seems in older versions we need to make sure we really do pass it a dict. So something like this:

        keys = req.subprocess_env.keys()
        tmp_env = {}
        for k in keys:
            tmp_env[k] = req.subprocess_env[k]
        os.environ.update(tmp_env)

is required (this is what the newer os.py does anyway).

Change History (2)

comment:1 by nick.phillips@…, 18 years ago

Actually, I guess this may depend on the version of mod_python too -- I have 2.7.10 (as debian's 2:2.7.10-4). Perhaps subprocess_env really is a dict in more recent versions?

I say this because it seems that all sorts of problems are arising that might be resolved by a newer mod_python (next one is req.ap_auth_type not present, causing AttributeError).

Damn. Now I see that it actually *is* documented that I need mod_python 3.x...

/me hangs head in shame

Cheers,

Nick

comment:2 by Adrian Holovaty, 18 years ago

Resolution: invalid
Status: newclosed

So this isn't an issue, then, on mod_python 3.x? I'm closing the ticket...

Note: See TracTickets for help on using tickets.
Back to Top