<div class="gmail_quote">On Thu, Dec 3, 2009 at 12:38 PM, Carsten Haese <span dir="ltr"><<a href="mailto:carsten.haese@gmail.com">carsten.haese@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Victor Subervi wrote:<br>
>     No, it doesn't, because you've only provided one third of what I asked<br>
>     for. I also asked for the code and the inputs that go into it.<br>
><br>
><br>
> I provided those earlier.<br>
<br>
</div>No, you didn't provide the exact code you're running. You provided a<br>
selected snippet you deemed important, but because you don't actually<br>
know what the problem is and where it is, your determination of what's<br>
important is not helpful. You actually managed to snip away the part<br>
that causes the problem.<br>
<br>
The code snipped you posted earlier showed cgi.FieldStorage being called<br>
once. The code you're posting now makes it clear that cgi.FieldStorage<br>
is actually called multiple times in a loop:<br>
<br>
> [snip...]<br>
<div class="im">> def optionsPrintout(table):<br>
>   form = cgi.FieldStorage()<br>
>   fn = getattr(options, table)<br>
>   ourOptionsNames = []<br>
>   optionsNames, doNotUse  = fn('names')<br>
><br>
</div>> [snip...]<br>
><br>
>   for table in storesTables:<br>
>       [snip...]<br>
>       print optionsPrintout(table)<br>
>       [snip ...]<br>
<br>
The problem is that the first call to cgi.FieldStorage() consumes all<br>
POST variables that were given to the script, so any subsequent call<br>
reads an empty file and results in an empty FieldStorage object. Rewrite<br>
your code to construct the FieldStorage object once and refer to that<br>
one object in every pass of the loop.<br>
<br>
As you can see, and as I suspected, it's not a bug in the cgi module.<br></blockquote><div><br>Thank you! Well, I suspected it wasn't a bug either, but I was at my wit's end and pulling straws.<br>Thanks again!<br>
V<br></div></div><br>