Patches item #1159139, was opened at 2005-03-08 17:04 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1159139&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: Library (Lib) Group: Python 2.4 >Status: Pending >Resolution: Rejected Priority: 5 Private: No Submitted By: Joe (joesalmeri) Assigned to: Nobody/Anonymous (nobody) Summary: cgi.py invalid REQUEST_METHOD set Initial Comment: Python Version 2.4 OS Windows XP SP 2 + WindowsUpdates Patch for lastest CVS Tree When the environment does not have a correctly set REQUEST_METHOD cgi.py prompts for key=value pairs by reading from sys.stdin. After the values are read from sys.stdin they are never stored in the FieldStorage.list attribute like they are when the FieldStorage.read_urlencoded or FieldStorage.read_multi methods are called. This causes a problem when FieldStorage.keys() is called because although the values were read from sys.stdin they were never stored in FieldStorage.list. Although you could argue that REQUEST_METHOD should have been set correctly in the first place, it still seems like if cgi.py is going to handle that situation by actually reading the values from sys.stdin it should store them too. This fix stores the values read. ---------------------------------------------------------------------- >Comment By: Martin v. Löwis (loewis) Date: 2007-03-06 14:23 Message: Logged In: YES user_id=21627 Originator: NO I must be completely missing the point of this patch. Where in the code does it currently prompt for key=value pairs if REQUEST_METHOD is not correctly set? By "not correctly set", do you mean "not set" or "set incorrectly"? If the latter, to what value? You seem to be modifying the read_single function. This is meant to read a single body of the CGI request (as sent by the HTTP client), not the key-value-pairs. I've tried to come up with a demo application of this new functionality, but failed: I couldn't make this new code do anything useful. What Python script should I use, how should I invoke it, what environment variables should I give, and what standard input? Tentatively rejecting the patch. ---------------------------------------------------------------------- Comment By: Jim Jewett (jimjjewett) Date: 2005-03-14 23:54 Message: Logged In: YES user_id=764593 +1 on supporting use without a REQUEST_METHOD, if only to match Perl on "what happens if my .cgi was called straight from the command line"? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1159139&group_id=5470 _______________________________________________ Patches mailing list Patches@python.org http://mail.python.org/mailman/listinfo/patches