[Python-bugs-list] [ python-Bugs-801992 ] cgi.CGIHTTPRequestHandler remembers QUERY_STRING

SourceForge.net noreply at sourceforge.net
Sun Sep 7 13:48:19 EDT 2003


Bugs item #801992, was opened at 2003-09-07 15:44
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801992&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Ivo Danihelka (fidlej)
Assigned to: Nobody/Anonymous (nobody)
Summary: cgi.CGIHTTPRequestHandler remembers QUERY_STRING

Initial Comment:
Python 2.3+, Debian SID:

cgi.CGIHTTPRequestHandler remembers QUERY_STRING from

last query.

If query is '', then condition "if query:" fails and

env['QUERY_STRING'] is remembered from last query.



Solution:

--- /usr/lib/python2.3/CGIHTTPServer.py 2003-09-07

15:33:41.000000000 +0200

+++ CGIHTTPServer.py    2003-09-07 15:36:27.000000000 +0200

@@ -147,8 +147,7 @@

         env['PATH_INFO'] = uqrest

         env['PATH_TRANSLATED'] =

self.translate_path(uqrest)

         env['SCRIPT_NAME'] = scriptname

-        if query:

-            env['QUERY_STRING'] = query

+        env['QUERY_STRING'] = query

         host = self.address_string()

         if host != self.client_address[0]:

             env['REMOTE_HOST'] = host







----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2003-09-07 21:48

Message:
Logged In: YES 
user_id=21627

I believe the bug lies elsewhere: If we have fork, we

shouldn't set the environment variables in the parent

process, but only in the child process.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=801992&group_id=5470



More information about the Python-bugs-list mailing list