ANN: grassi python 3.0

t. middletan t.middletan at news.vex.net
Tue Dec 7 01:41:05 EST 1999


quinn at dinar.ugcs.caltech.edu (Quinn Dunkan) wrote:
>But it DOESN'T do what he wants! 

You are right. My brain short circuited as usual. Why i considered
1/0 a syntax error in my example is a complete mystery to me. Heh.

>(and behold well, because it took me a while to figure out how
>to make a syntax error in perl):

Just leave out a few semi-colons or braces. Wooo.

>Therefore, perl also sucks as a cgi language.  Grassi is right;
>everyone else is just plain wrong.

Maybe you guys should form a club or something? <wink>

>py = popen2.Popen3('python ' + sys.argv[1], 1)

Ah, the wrapper concept taken to new heights... new heights of...
something. Heh. Someone should be collecting all these 'creative'
solutions! 

>The way I can think of involves dup()... but I'll leave
>that for Dan... 

Yep, you can't do everything. Especially since you'll be so busy now
porting all your stuff to PHP. <g> 

(Though i still think a 'simple' non-wrapper solution for non-syntax
errors --- a la Carp, but not so bizarre looking --- would be useful
for some... Fredrik's idea of using the sys.exitfunc might work? 

Say for example cgi.errorsToBrowser() which would set stderr to be
redirected to StringIO object, sets an exitfunc() which checks 
sys.last_traceback (as Fredrik suggested)... and if there is a
traceback then to print minimal headers and the traceback.. 

Yes, i know that this is a security risk generally, and that
it won't stop the syntax/compile errors, and the function would
even be generally annoying probably to anyone who knows what
they are doing... but still, it seems to me some might benefit
from it, making it so simple to catch many errors easily with
python CGI.)








More information about the Python-list mailing list