[python-win32] manipulating service action restart behavior?

2011-08-08 Thread Andrew Hammond
I am trying to control the behavior of a service with regards to failure handling as described here: http://blogs.msdn.com/b/jcalev/archive/2008/01/10/some-tricks-with-service-restart-logic.aspx I have done some reading and have the following snippet of code that I think is going in the right dire

Re: [python-win32] manipulating service action restart behavior?

2011-08-09 Thread Andrew Hammond
message: TypeError: SERVICE_FAILURE_ACTIONS must be a dictionary containing {'ResetPeriod':int,'RebootMsg':unicode,'lpCommand':unicode,'Actions':sequence of 2 tuples(int,int) Which I think is what I'm feeding it. Can someone please tell me what I'

Re: [python-win32] manipulating service action restart behavior?

2011-08-10 Thread Andrew Hammond
ou are on python 2, then: > > 'RebootMsg': '', > 'lpCommand': '', > > Is two strings, not unicode. Maybe: > > 'RebootMsg': u'', > 'lpCommand': u'', > > > ---

Re: [python-win32] manipulating service action restart behavior?

2011-08-10 Thread Andrew Hammond
the attached patch to correct the error message. Andrew On Wed, Aug 10, 2011 at 12:08 PM, Andrew Hammond < [email protected]> wrote: > I tried that change and get the exact same error message. I found the code > sending the error message in pywin32/win32/src/win32

[python-win32] lingering open filehandle?

2012-02-08 Thread Andrew Hammond
We're using pycurl to download a file. The file is written to disk in the context of a with statement. Once the file is written, we exit the context and then do an os.rename() to move the downloaded file to it's final destination. Immediately before doing the rename, I confirm that the filehandle i

[python-win32] windows firewall woes?

2012-03-05 Thread Andrew Hammond
We have python running on a number of devices in the field and have experienced problems where it appears that a windows update has removed a windows firewall exception, blocking our python service from operating. Has anyone else experienced something like this? Is there a way to fix it without hu

Re: [python-win32] windows firewall woes?

2012-03-08 Thread Andrew Hammond
366449(v=vs.85).aspx > > Some simplistic VBScript examples of using those interfaces: > > http://msdn.microsoft.com/en-us/library/windows/desktop/aa366421(v=vs.85).aspx > > I'd use the VBScript examples as a base and determine what kind of > exception is best for your needs.

Re: [python-win32] windows firewall woes?

2012-03-09 Thread Andrew Hammond
fully-qualified paths. > > (The error code shown appears to be ERROR_INVALID_POINTER, but that might > be a red herring) > > Mark > > > On 9/03/2012 11:16 AM, Andrew Hammond wrote: > >> With the following code, >> >> def add_firewall_excepti

[python-win32] determining service startType

2013-10-14 Thread Andrew Hammond
Hi All, I know how to change a service's configuration to manipulate the startType using win32serviceutil.ChangeServiceConfig('my_service', startType=4) # disable for example, but how do I query the current startType? Andrew ___ python-win32 mailing l