ASP problem (activestate 2.1, winNT)

KellyK kelly.kranabetter at gems6.gov.bc.ca
Wed May 16 16:19:30 EDT 2001


On Wed, 16 May 2001 15:48:44 GMT, jim at publishingresources.com (Jim
Abrams) wrote:

>I believe it has something to do with the object I assign to sys.stdout, 
>mapping a .write function to Response.Write to get print statements to work.
>
>Ideas on what this is?

Modules (the sys module in this case) under ASP are loaded once and
are persistent across hits. Assigning a value to stdout will usually
work but there can be collisions when two pages are hit at the same
time.

eg:
1) 'page1.asp' is hit and assigns a value to stdout
2) 'page2.asp' is hit assigns a value to stdout
3) 'page1.asp' continues execution and tries to print something to
stdout and explodes.

It is hard to track down the problem because the page1.asp and
page2.asp must get a hit at the same time. You can probably reproduce
the behavior if you slow down the execution of the scripts by putting
a time.sleep call after you change stdout.

That's my guess anyway!



More information about the Python-list mailing list