473,725 Members | 2,264 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bug Report / Patch (1159139 cgi.py invalid REQUEST_METHOD set)

Joe
Back in March I submitted a patch for cgi.py to sourceforge to fix a problem
with the handling of an invalid REQUEST_METHOD.

I thought I followed all the steps to properly submit the bug and patch but
the patch is still sitting there in limbo.

This is the first patch I have submitted for Python, did I miss a step in
the patch process?

What else needs to be done?

Thanks!

Jul 26 '05 #1
3 2300
Joe wrote:
Back in March I submitted a patch for cgi.py to sourceforge to fix a problem
with the handling of an invalid REQUEST_METHOD.

I thought I followed all the steps to properly submit the bug and patch but
the patch is still sitting there in limbo.

This is the first patch I have submitted for Python, did I miss a step in
the patch process?

What else needs to be done?


Can you provide an example script demonstrating the problem you describe?

I tried something like this (Py2.4.1):

------- test_cgi.py
#!/bin/env python
import cgi
fs = cgi.FieldStorag e()
print fs

$ python test_cgi.py "a=1&b=2"
FieldStorage(No ne, None, [MiniFieldStorag e('a', '1'), MiniFieldStorag e('b', '2')])
$

There's no REQUEST_METHOD or QUERY_STRING env var set.

Reinhold
Jul 26 '05 #2
Joe wrote:
Back in March I submitted a patch for cgi.py to sourceforge to fix a problem
with the handling of an invalid REQUEST_METHOD.

I thought I followed all the steps to properly submit the bug and patch but
the patch is still sitting there in limbo.


Patches get processed when people have the time to review them.

If you'd like to speed up the process, a few people on the python-dev
list have promised to review a patch if the requester reviews 5 other
patches. So if you want to get your patch looked at:

(1) pick 5 other patches
(2) try them on your system
(3) make a helpful comment on each of the patch trackers
(4) send a summary of your reviews to the python-dev list, along with a
link to the patch you'd like reviewed.

HTH,

STeVe
Jul 26 '05 #3
Joe
Reinhold,

Thanks for responding...

I see that you are using Python 2.4.1 and the bug was against 2.4. (I am
now using 2.4.1)

If I remember correctly there were two issues that I ran into, one was with
a missing REQUEST_METHOD and the other was with a INCORRECT request method.
As per your example the missing one does not seem to be a problem any
longer.

The incorrect REQUEST_METHOD setting still seems to be an issue with Python
2.4.1.

Make the following changes to your code to demonstrate that problem.

import cgi
import os # NEW

os.environ['REQUEST_METHOD '] = 'cgi' # NEW

field = cgi.FieldStorag e()

print field
print field.keys() # NEW

Run the program now with NO parameters. (I'm running on WinXP SP2).

After you start the program cgi.py will be reading from stdin.

type "a=1" and hit enter
type "b=2" and hit enter
press ctrl-z (to send eof) and hit enter

You will get the following stack trace.

FieldStorage(No ne, None, 'a=1\nb=2\n')
Traceback (most recent call last):
File "H:\1\t2.py ", line 12, in ?
print field.keys()
File "P:\SW\Python\l ib\cgi.py", line 601, in keys
TypeError: not indexable

When the environment does not have a correctly set REQUEST_METHOD cgi.py
prompts
for key=value pairs by reading from sys.stdin. (as demonstrated above) I
realize REQUEST_METHOD
should be set properly but hear me out.

After the values are read from sys.stdin they are never stored in the
FieldStorage.li st attribute like they are
when the FieldStorage.re ad_urlencoded or FieldStorage.re ad_multi methods are
called. The read_single
method is the one that has the problem (it is inconsistenty with the other
two methods because it doesn't
store the values like the other two methods do).

This causes a problem when FieldStorage.ke ys() is called because although
the values were read from
sys.stdin they were never stored in FieldStorage.li st.

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 of a invalid
REQUEST_METHOD by actually reading the
values from sys.stdin (it already does this part) it should store them too
(especially since it does store the values in the other two methods).

Does that explain the issue more clearly?
"Reinhold Birkenfeld" <re************ ************@wo lke7.net> wrote in
message news:3k******** ****@individual .net...
Joe wrote:
Back in March I submitted a patch for cgi.py to sourceforge to fix a
problem
with the handling of an invalid REQUEST_METHOD.

I thought I followed all the steps to properly submit the bug and patch
but
the patch is still sitting there in limbo.

This is the first patch I have submitted for Python, did I miss a step in
the patch process?

What else needs to be done?


Can you provide an example script demonstrating the problem you describe?

I tried something like this (Py2.4.1):

------- test_cgi.py
#!/bin/env python
import cgi
fs = cgi.FieldStorag e()
print fs

$ python test_cgi.py "a=1&b=2"
FieldStorage(No ne, None, [MiniFieldStorag e('a', '1'),
MiniFieldStorag e('b', '2')])
$

There's no REQUEST_METHOD or QUERY_STRING env var set.

Reinhold

Jul 26 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1554
by: Irmen de Jong | last post by:
Hi I've submitted a bug report on Sourceforge (http://sourceforge.net/tracker/?func=detail&aid=839496&group_id=5470&atid=105470) but am wondering what to do next? Should I have assigned it to somebody, or will it be noticed 'automagically'...? Sorry for being ignorant in this matter...
1
19177
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal Report at runtime? Example: private void button1_Click(object sender,
0
2051
by: Greg Christie | last post by:
I think I have a somewhat unique situation here, so I thought I should post it for the few poor souls who run across it and try to google it like I did. First of all, I was getting the following error when trying to hit one of my pages... --------------------------------------------------------------------- Invalid URI: There is an invalid sequence in the string. ---------------------------------------------------------------------
2
2699
by: Sharon | last post by:
I've had an Access 2000 app running successfully for many months on both Windows XP and Windows 2000. Recently when my Windows 2000 users call a particular report, they get first a dialog requesting a "Replace" parameter. If the user clicks OK, the report opens, but only displays #Error. When the user tries to close the report, he is next presented with the choice of halting the code in break mode or not. Regardless of his choice, the app...
4
10051
by: John Galt | last post by:
I need to save a report to an RTF and I am using OutputTo acReport: DoCmd.OutputTo acReport, stDocName, acFormatRTF, TodaysDir & "-" & "Name.rtf" This command saves the report nicely, however I cannot filter the report like I can on an OpenReport and providing a filter statement. Has anyone found a good way to do this. I do not want my user to open and preview the report. It must be done
9
3075
by: Colin McGuire | last post by:
Hi, I have an report in Microsoft Access and it displays everything in the table. One column called "DECISION" in the table has either 1,2, or 3 in it. On my report it displays 1, 2, or 3. I want to appear in the report is Yes, No, or Maybe. What do I need to do to change what appears in the report/what term do I need to search out in Google? Thank you Colin
7
3568
by: Ellen Manning | last post by:
I've got an A2K report showing students and their costs. Student info is in the main report and costs are in a subreport for each student. The user inputs the program desired then only those students in that program are printed. I want the subreports headings to print only for the first student on the page. Is there a way to suppress printing of the headings on subsequent students on that page? I tried the following in both the...
2
9345
by: amith.srinivas | last post by:
Hi all, From a word macro in VBA, I am trying to create a report in access DB. The report is based on a query with a parameter. I am using Set rpt = Application.CreateReport rpt.RecordSource = <<Query_Name>> Once I create the report, I m trying to create labels to display the Report title in the Report Header section.
0
4572
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 349 open ( +7) / 3737 closed (+25) / 4086 total (+32) Bugs : 939 open (-12) / 6648 closed (+60) / 7587 total (+48) RFE : 249 open ( -8) / 278 closed (+12) / 527 total ( +4) New / Reopened Patches ______________________
0
8889
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9179
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8099
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3228
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.