Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7628639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:37:47+00:00 2026-05-31T05:37:47+00:00

I inherited a project using the Twisted Python library. The application is terminating after

  • 0

I inherited a project using the Twisted Python library. The application is terminating after the user logs off of Windows XP.

The Python code has been converted to an executable using bbfreeze. In addition, the bbfreeze generated executable is registered as a Windows service using the instsrv.exe and srvany.exe.

I’ve taken a simple chat example from the Twisted website and create an executable from bbfreeze and registered it with instsrv and srvany and the same problem occurs: the executable stops running after the user logs off.

I’m inclined to think that something about Windows XP and the Twisted library’s is causing the application to terminate or stop running. In particular, I think it might be something within the reactor code that’s causing the application code to stop running. However, I haven’t been able to confirm this.

Has anybody else seen this or have any ideas on what might be causing this?

Thanks,
Mark

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:37:49+00:00Added an answer on May 31, 2026 at 5:37 am
    • “Logging Off” MSDN page says that on log off,
      • WM_QUERYENDSESSION is sent to every window [on the current desktop];
      • CTRL_LOGOFF_EVENT is sent to every process.
    • ejabberd service stops on user logoff/login suggests that a process can terminate if it has no handler for CTRL_LOGOFF_EVENT.

    Judging by “I can also reproduce this with a simple chat sample” comment, Twisted is the culprit. Folks on the Internet do report that Twisted services fail in this manner sometimes: Re: SIGBREAK on windows.

    Twisted has an internal logging facility. An example of using it is in the answer to Twisted starting/stopping factory/protocol less noisy log messages. Had you used it, you would already have seen the “received SIGBREAK…” message pointing to the root cause.


    BTW, I use the code like below to log unhandled exceptions in my scripts. This is always a good idea if the script is to be ever run unattended (or by others that you diagnose problems for :^) ).

    # set up logging #####################################
    import sys,os,logging
    logfile = os.path.splitext(os.path.basename(sys.argv[0]))[0]+".log"
    logging.basicConfig(\
        format='%(asctime)s %(levelname)-8s %(message)s',\
        filename=logfile,\
        level=logging.DEBUG)
    l = logging.getLogger()
    #to avoid multiple copies after restart from pdb prompt
    if len(l.handlers)<=1: l.addHandler(logging.StreamHandler(sys.stdout))
    #hook to log unhandled exceptions
    def excepthook(type,value,traceback):
        logging.exception("Unhandled exception occured",exc_info=(type,value,traceback))
        old_excepthook(type,value,traceback)
    old_excepthook = sys.excepthook
    sys.excepthook = excepthook
    # ####################################################
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have inherited a project that has class libraries written in VB.NET, some of
I've inherited a flash project (my first) that has many existing symbols in the
I've inherited a java project that appears to have been developed using the NetBeans
I'm attempting to modify an inherited project that has a convoluted process of displaying
I've inherited a project consisting of three levels of code. The lowest layer is
I've inherited a project and we are using git. We have a number of
So I inherited this Android project from someone else. The code currently seems to
I just inherited a large web project using SVN for VCS. There are no
i've inherited a project that is using subsonic. I wish to extend the OrderItem
I've just inherited a project which was maintained using Git. At one point, the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.