Odd cgi.FieldStorage behavior

F

Fred Murray

Hi all,

When uploading a file ("input type=file"), FieldStorage usually
behaves correctly, but every once in a while (every couple days?), it
will suddenly start causing internal server errors. A look at the
apache (v. 2.0.44 on Linux) error log shows "premature end of script
headers" with no error messages from Python. After reloading the
browser about 10 times in a row, it will suddenly start working again.
Recently, when a series of these errors was occuring, I removed the
FieldStorage line from my program and it completed normally. When I
put the line back in again, the internal server errors resumed. Thus,
it seems that the bug is either in FieldStorage itself or in something
FieldStorage interacts with.

It seems odd that that there are no errors in the log from Python.
Does this mean the program is crashing before it can output a
traceback to stderr?

Cheers,
Fred
 
T

Tim Roberts

When uploading a file ("input type=file"), FieldStorage usually
behaves correctly, but every once in a while (every couple days?), it
will suddenly start causing internal server errors. A look at the
apache (v. 2.0.44 on Linux) error log shows "premature end of script
headers" with no error messages from Python. After reloading the
browser about 10 times in a row, it will suddenly start working again.
Recently, when a series of these errors was occuring, I removed the
FieldStorage line from my program and it completed normally. When I
put the line back in again, the internal server errors resumed. Thus,
it seems that the bug is either in FieldStorage itself or in something
FieldStorage interacts with.

It seems odd that that there are no errors in the log from Python.
Does this mean the program is crashing before it can output a
traceback to stderr?

It often means the script terminated normally without outputting any HTML,
or that you caught an error with a try/finally and didn't reraise the
error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top