ASP KeyboardInterrupt errors

Discussion in 'Python' started by Steve Holden, Jun 24, 2003.

  1. Steve Holden

    Steve Holden Guest

    [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/
     
    Steve Holden, Jun 24, 2003
    #1
    1. Advertising

  2. Steve Holden

    Max M Guest

    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/python-list/2001-April/039881.html and
    http://mail.python.org/pipermail/python-list/2002-April/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>
     
    Max M, Jun 24, 2003
    #2
    1. Advertising

  3. Steve Holden

    Mark Hammond Guest

    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/python-list/2001-April/039881.html and
    > http://mail.python.org/pipermail/python-list/2002-April/099002.html for an
    > explanation


    Note that recent win32alls also have this hack in place.

    Mark.
     
    Mark Hammond, Jun 28, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Goldin

    Errors, errors, errors

    Mark Goldin, Jan 17, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,009
    Mark Goldin
    Jan 17, 2004
  2. Ivan Nestlerode

    KeyboardInterrupt and threading

    Ivan Nestlerode, Jan 2, 2004, in forum: Python
    Replies:
    8
    Views:
    571
    Anand Pillai
    Jan 8, 2004
  3. PantherSE
    Replies:
    0
    Views:
    376
    PantherSE
    May 16, 2005
  4. Operation Latte Thunder

    KeyboardInterrupt being lost?

    Operation Latte Thunder, Oct 14, 2005, in forum: Python
    Replies:
    1
    Views:
    416
    David Wahler
    Oct 14, 2005
  5. Tamas Nepusz
    Replies:
    4
    Views:
    633
    Dieter Maurer
    Oct 22, 2005
Loading...

Share This Page