[ python-Bugs-801992 ] cgi.CGIHTTPRequestHandler remembers QUERY_STRING

SourceForge.net noreply at sourceforge.net
Sat Jun 25 22:02:34 CEST 2005


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

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.3
>Status: Closed
>Resolution: Duplicate
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: Reinhold Birkenfeld (birkenfeld)
Date: 2005-06-25 22:02

Message:
Logged In: YES 
user_id=1188172

This is a duplicate of #777848, closing as such.

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

Comment By: Raymond Hettinger (rhettinger)
Date: 2003-09-10 05:40

Message:
Logged In: YES 
user_id=80475

See the patch at www.python.org/sf/796772

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

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