win32com.client.GetActiveObject does not find App when run as an SVN post-commit hook

812 views Asked by At

I created a python script (packaged as post-commit.exe) to run as an SVN post commit hook. Yes, the hook runs, but this is the line I am having problems with:

App = win32com.client.GetActiveObject("EA.App")

This issue does not happen on Windows 7, but is now happening on Windows Server 2012 R2 with the same installs:

TortoiseSVN-1.9.0.26652-x64-svn-1.9.0.msi

pywin32-220.win-amd64-py3.3.exe

python-3.3.0.amd64.msi

I used pip to explicitly install pypiwin32, but I can't tell if it actually worked or not (or if it matters). It says it's installed, but at the end of the install it gives me the following even tho I ran as admin:

PermissionError: [Errno 13] Permission denied: 'c:\\python33\\Lib\\site-packages\\pythoncom.py'

When I open this .exe it runs fine and works as expected, but when it is kicked off by the actual SVN commit, SVNTortoise gives me the error message below. I had problems with SVN deleting PATH for other lines of code, so I have also tried the full path to where EA.exe lives. I ran wmic get ProcessID and also tried what that gave me... but these do not work either:

App = win32com.client.GetActiveObject(r"C:\Program Files (x86)\Sparx Systems\EA\EA.App")
App = win32com.client.GetActiveObject(r"C:\PROGRA~2\SPARXS~1\EA\EA.App")

Any help would be greatly appreciated. I have spent a lot of time googling and searching stackoverflow for answers, but can't find anything for this specific problem. Thanks!!

SVN Error output:

post-commit hook failed (exit code -1) with output:
Traceback (most recent call last):
  File "ATC_Generator.py", line 58, in <module>
  File "site-packages\win32com\client\__init__.py", line 78, in GetActiveObject
pywintypes.com_error: (-2147221005, 'Invalid class string', None, None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "site-packages\win32com\client\dynamic.py", line 89, in _GetGoodDispatch
pywintypes.com_error: (-2147221005, 'Invalid class string', None, None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "ATC_Generator.py", line 61, in <module>
  File "site-packages\win32com\client\__init__.py", line 95, in Dispatch
  File "site-packages\win32com\client\dynamic.py", line 114, in _GetGoodDispatchAndUserName
  File "site-packages\win32com\client\dynamic.py", line 91, in _GetGoodDispatch
pywintypes.com_error: (-2147221005, 'Invalid class string', None, None)
Failed to execute script ATC_Generator
0

There are 0 answers