Script using generators produces different results when invoked as a CGI
Nick Craig-Wood
nick at craig-wood.com
Mon May 5 13:30:03 EDT 2008
Gabriel Genellina <gagsl-py2 at yahoo.com.ar> wrote:
> En Mon, 05 May 2008 00:31:45 -0300, Barclay, Ken <Ken.Barclay at schwab.com> escribió:
>
> > I attended David Beazley's awe-inspiring tutorial on the use of
> > generators in systems programming:
> >http://www.dabeaz.com/generators/
> > <BLOCKED::http://www.dabeaz.com/generators/>
> >I used his approach to write a web tool that can display search results
> > from different log files. But the resulting script produced fewer
> > results when invoked as CGI than it did when run from the command line,
> > and I can't figure out why.
>
> > Problem: For small sets of files this works great. But when I had 19Meg
> > worth of log files in a test directory, the script would return the
> > correct number of matching lines (288) only when it was invoked directly
> > from the command line. When invoked from a CGI script, it returns 220
> > lines instead
>
> No entry in the error log, on the web server? (Apache?)
> Perhaps you're hitting some internal limit of the cgi process, either memory or cpu time per request or temp file size...
> Are you sure the script runs to completion? Output a message at the
> end, to be sure.
Check the ownership of all the files too. Remember that the web
server (and hence your cgi) will likely run as nobody or www-data.
You are unlikely to be logging in as one of those users.
--
Nick Craig-Wood <nick at craig-wood.com> -- http://www.craig-wood.com/nick
More information about the Python-list
mailing list