title: Python script service generates alert in the event log with id 7039
body: <p>If I try to do this it doesn't generate the warning:</p>
  <pre><code>Test.py install
  Test.py start
  </code></pre>
  <p>Otherwise if I use pyinstaller:</p>
  <pre><code>pyinstaller -F --hidden-import=win32timezone Test.py
  </code></pre>
  <p>And then I try to do:</p>
  <pre><code>Test.exe install
  Test.exe start
  </code></pre>
  <p>I see this warning in the event log:</p>
  <pre><code>A service process other than the one started by Service Control Manager connected when the TestService service started. Service Control Manager started process 5328 and connected process 1512.
  
  Note that if the service is configured to start inside a debugger, this behavior is expected.
  </code></pre>
  <p>Script:</p>
  <pre><code>import servicemanager
  import socket
  import sys
  import win32event
  import win32service
  import win32serviceutil
  
  
  class TestService(win32serviceutil.ServiceFramework):
      _svc_name_ = &quot;TestService&quot;
      _svc_display_name_ = &quot;Test Service&quot;
      _svc_description_ = &quot;My service description&quot;
  
      def __init__(self, args):
          win32serviceutil.ServiceFramework.__init__(self, args)
          self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)
          socket.setdefaulttimeout(60)
  
      def SvcStop(self):
          self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
          win32event.SetEvent(self.hWaitStop)
  
      def SvcDoRun(self):
          rc = None
          while rc != win32event.WAIT_OBJECT_0:
              with open('C:\\TestService.log', 'a') as f:
                  f.write('test service running...\n')
              rc = win32event.WaitForSingleObject(self.hWaitStop, 5000)
  
  
  if __name__ == '__main__':
      if len(sys.argv) == 1:
          servicemanager.Initialize()
          servicemanager.PrepareToHostSingle(TestService)
          servicemanager.StartServiceCtrlDispatcher()
      else:
          win32serviceutil.HandleCommandLine(TestService)
  </code></pre>
  <p>How can I start the service without this warning appearing?</p>