Issue Details (XML | Word | Printable)

Key: MODPYTHON-187
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Graham Dumpleton
Reporter: Alan Kennedy
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
mod_python

Hang on subscripted access to request.subprocess_env.

Created: 28/Aug/06 03:40 PM   Updated: 01/May/07 10:46 AM
Return to search
Component/s: core
Affects Version/s: 3.2.10
Fix Version/s: 3.3.1

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works MP187-2006-08-28-jgallacher-1.diff 2006-08-29 12:51 AM Jim Gallacher 0.7 kB
Environment:
Apache: 2.0.59
ModPython: 3.2.10
Python: 2.4
OS: Windows Server 2003

Resolution Date: 02/Oct/06 04:51 AM


 Description  « Hide
When subscripted access is used to access variable 'SCRIPT_FILENAME' in the request.subprocess_env table/mapping, the code hangs.

The following snippet illustrates the problem.

# -=-=-=-=-=-=

def postreadrequesthandler(request):
  request.add_common_vars()
  value = request.subprocess_env['SCRIPT_FILENAME'] # This hangs
# value = request.subprocess_env.get('SCRIPT_FILENAME')# This works
  return apache.OK

# -=-=-=-=-=-=

The strange thing is that the .get() access works fine: only the subscript hangs?

If anyone is wondering about a use-case, I don't actually have one. I was just iterating over the contents of the request.subprocess_env using a for loop (code below), and found that the code hung when accessing 'SCRIPT_FILENAME', and not for any other variable.

# -=-=-=
request.add_common_vars()
d = {}
for sek in request.subprocess_env.keys():
  d[sek] = request.subprocess_env[sek]
# -=-=-=


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #451878 Mon Oct 02 04:49:35 UTC 2006 grahamd (MODPYTHON-187) Table objects could crash in various ways when the value of
an item was NULL. This could occur for SCRIPT_FILENAME when the
req.subprocess_env table was accessed in the post read request handler
phase.
Files Changed
MODIFY /httpd/mod_python/trunk/test/htdocs/tests.py
MODIFY /httpd/mod_python/trunk/src/tableobject.c
MODIFY /httpd/mod_python/trunk/Doc/appendixc.tex

Repository Revision Date User Message
ASF #451881 Mon Oct 02 04:56:19 UTC 2006 grahamd (MODPYTHON-189) Fixed representation returned by calling repr() on a table
object. Note this was committed as part of change for MODPYTHON-187.
Files Changed
MODIFY /httpd/mod_python/trunk/Doc/appendixc.tex