[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/winservice/service.py Import pywintypes first.

Tim Peters tim.one at comcast.net
Wed Jun 8 11:29:57 EDT 2005


Log message for revision 30687:
  Import pywintypes first.
  
  Mark Hammond's checkin comment for Zope 2.7's WinSignalHandler.py,
  rev 1.1.2.2:
  
  """
  As at pywin32-204, we must ensure pywintypes is the first win32 module
  imported in our process, otherwise we can end up with 2 pywintypesxx.dll
  instances in our process resulting in:
  TypeError: The object is not a PySECURITY_ATTRIBUTES object
  """
  
  Mysterious error popup boxes have also been seen, on boxes with a
  pre-pywin32-204 installation leaving pywin32 DLLs in the system32
  directory.
  

Changed:
  U   Zope3/trunk/src/zope/app/winservice/service.py

-=-
Modified: Zope3/trunk/src/zope/app/winservice/service.py
===================================================================
--- Zope3/trunk/src/zope/app/winservice/service.py	2005-06-08 11:44:59 UTC (rev 30686)
+++ Zope3/trunk/src/zope/app/winservice/service.py	2005-06-08 15:29:57 UTC (rev 30687)
@@ -16,13 +16,14 @@
 Windows NT/2K service installer/controller for Zope/ZEO/ZRS instances.
 """
 
+import time
+import os
+
+import pywintypes
 import win32serviceutil
 import win32service
 import win32event
 import win32process
-import pywintypes
-import time
-import os
 
 # the max seconds we're allowed to spend backing off
 BACKOFF_MAX = 300
@@ -97,13 +98,13 @@
         backoff_cumulative = 0
 
         import servicemanager
-        
+
         # log a service started message
         servicemanager.LogMsg(
             servicemanager.EVENTLOG_INFORMATION_TYPE,
             servicemanager.PYS_SERVICE_STARTED,
             (self._svc_name_, ' (%s)' % self._svc_display_name_))
-        
+
         while 1:
             start_time = time.time()
             info = self.createProcess(self.start_cmd)
@@ -172,7 +173,7 @@
 
         # log a service stopped message
         servicemanager.LogMsg(
-            servicemanager.EVENTLOG_INFORMATION_TYPE, 
+            servicemanager.EVENTLOG_INFORMATION_TYPE,
             servicemanager.PYS_SERVICE_STOPPED,
             (self._svc_name_, ' (%s) ' % self._svc_display_name_))
 



More information about the Zope3-Checkins mailing list