Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > ASP KeyboardInterrupt errors

Reply
Thread Tools

ASP KeyboardInterrupt errors

 
 
Steve Holden
Guest
Posts: n/a
 
      06-24-2003
[repost due to non-appearance of mailed posting]

I'm mailing the list in the hope that somebody has come up with a solution
to the occasional spurious "Keyboard Interrupt" exception that gets raised
in the ASP environment. It's a little awkward to explain to my client why
his COM server is failing this way, and the logic of the application makes
it difficult to trap the exception and repeat what's already been done.

I can't find anything with Google that makes it look like this problem is
still being addressed.

regards
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/pwp/


 
Reply With Quote
 
 
 
 
Max M
Guest
Posts: n/a
 
      06-24-2003
Steve Holden wrote:
> [repost due to non-appearance of mailed posting]
>
> I'm mailing the list in the hope that somebody has come up with a solution
> to the occasional spurious "Keyboard Interrupt" exception that gets raised
> in the ASP environment. It's a little awkward to explain to my client why
> his COM server is failing this way, and the logic of the application makes
> it difficult to trap the exception and repeat what's already been done.
>
> I can't find anything with Google that makes it look like this problem is
> still being addressed.



I have saved a hack for this:


From:
"Chris Prinos" <>
Date:
Thu, 30 May 2002 00:21:56 GMT
Newsgroups:
comp.lang.python

I had the same issue with my IIS system, and had to use a workaround that
disables the KeyboardInterrupt from being processed. The code I use is
shown below.

see http://mail.python.org/pipermail/pyt...il/039881.html and
http://mail.python.org/pipermail/pyt...il/099002.html for an
explanation


Chris
----------------------------------------------------------------------------
----------------


<!--
These first two script blocks are needed because IIS looks for a SCRIPT
block in the default scripting language of the server. That could be
JScript or VBScript, but it won't be Python.

This is only a problem for this global.asa file.
-->
<SCRIPT LANGUAGE=Jscript RUNAT=Server>
function dummy() {}
</SCRIPT>
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub dummy2
ignore = "me"
End Sub
</SCRIPT>

<SCRIPT LANGUAGE=Python RUNAT=Server>
def Application_OnStart():
# this signal code is a workaround for a bug that causes
# Ctl-C keyboard interrupts to be sent to the python activex engine.
# Not sure if this is a problem with ASP, or python, but if the
# handler is not provided, KeyboardInterrupts will pop up in the most
# inoportune places.
import signal
def noOp(a,b): pass
signal.signal(signal.SIGINT, noOp)
</SCRIPT>

 
Reply With Quote
 
 
 
 
Mark Hammond
Guest
Posts: n/a
 
      06-28-2003
Max M wrote:
> I have saved a hack for this:

....
>
> From:
> "Chris Prinos" <>
> Date:
> Thu, 30 May 2002 00:21:56 GMT
> Newsgroups:
> comp.lang.python
>
> I had the same issue with my IIS system, and had to use a workaround that
> disables the KeyboardInterrupt from being processed. The code I use is
> shown below.
>
> see http://mail.python.org/pipermail/pyt...il/039881.html and
> http://mail.python.org/pipermail/pyt...il/099002.html for an
> explanation


Note that recent win32alls also have this hack in place.

Mark.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
KeyboardInterrupt vs extension written in C Tamas Nepusz Python 4 10-22-2005 08:02 PM
KeyboardInterrupt being lost? Operation Latte Thunder Python 1 10-14-2005 09:18 PM
Socket object and KeyboardInterrupt exception PantherSE Python 0 05-16-2005 09:10 PM
Errors, errors, errors Mark Goldin ASP .Net 2 01-17-2004 08:05 PM
KeyboardInterrupt and threading Ivan Nestlerode Python 8 01-08-2004 11:12 AM



Advertisments