From robin at reportlab.com Thu May 5 05:18:04 2016 From: robin at reportlab.com (Robin Becker) Date: Thu, 5 May 2016 10:18:04 +0100 Subject: [python-win32] dbi.interalError Message-ID: <572B0FCC.9040501@chamonix.reportlab.co.uk> A client has changed database and now receives this error dbi.internalError: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application in LOGIN I suspect that this is due to something related to https://social.msdn.microsoft.com/Forums/sqlserver/en-US/702f0d9b-6cb9-49cf-9953-80d059711e60/the-specified-dsn-contains-an-architecture-mismatch-between-the-driver-and-application?forum=sqlgetstarted but can anyone explain what should be done to fix this? I have asked concerning the db machine 32/64bit etc etc and whether the python software is running on 32/64 bit python. -- Robin Becker From vernondcole at gmail.com Thu May 5 14:21:37 2016 From: vernondcole at gmail.com (Vernon D. Cole) Date: Thu, 5 May 2016 12:21:37 -0600 Subject: [python-win32] dbi.interalError In-Reply-To: <572B0FCC.9040501@chamonix.reportlab.co.uk> References: <572B0FCC.9040501@chamonix.reportlab.co.uk> Message-ID: More information about your program would be helpful. There are at least three ways that connections to SQL Server might be obtained in Python. In general, it would seem that the version of Python may have changed. The bit-width of the SQL Server server should not affect a data client. On Thu, May 5, 2016 at 3:18 AM, Robin Becker wrote: > A client has changed database and now receives this error > > > dbi.internalError: [Microsoft][ODBC Driver Manager] The specified DSN > contains an architecture mismatch between the Driver and Application in > LOGIN > > > I suspect that this is due to something related to > > > https://social.msdn.microsoft.com/Forums/sqlserver/en-US/702f0d9b-6cb9-49cf-9953-80d059711e60/the-specified-dsn-contains-an-architecture-mismatch-between-the-driver-and-application?forum=sqlgetstarted > > but can anyone explain what should be done to fix this? > > I have asked concerning the db machine 32/64bit etc etc and whether the > python software is running on 32/64 bit python. > -- > Robin Becker > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robin at reportlab.com Thu May 5 16:17:54 2016 From: robin at reportlab.com (Robin Becker) Date: Thu, 5 May 2016 21:17:54 +0100 Subject: [python-win32] dbi.interalError In-Reply-To: References: <572B0FCC.9040501@chamonix.reportlab.co.uk> Message-ID: Turns out it was a DSN driver issue ie 32 vs 64 bit windows. After prompting the client fixed the DSN and everything is now OK. Sorry for the noise. On 5 May 2016 at 19:21, Vernon D. Cole wrote: > More information about your program would be helpful. There are at least > three ways that connections to SQL Server might be obtained in Python. In > general, it would seem that the version of Python may have changed. The > bit-width of the SQL Server server should not affect a data client. > > > On Thu, May 5, 2016 at 3:18 AM, Robin Becker wrote: >> >> A client has changed database and now receives this error >> >> >> dbi.internalError: [Microsoft][ODBC Driver Manager] The specified DSN >> contains an architecture mismatch between the Driver and Application in >> LOGIN >> >> >> I suspect that this is due to something related to >> >> >> https://social.msdn.microsoft.com/Forums/sqlserver/en-US/702f0d9b-6cb9-49cf-9953-80d059711e60/the-specified-dsn-contains-an-architecture-mismatch-between-the-driver-and-application?forum=sqlgetstarted >> >> but can anyone explain what should be done to fix this? >> >> I have asked concerning the db machine 32/64bit etc etc and whether the >> python software is running on 32/64 bit python. >> >> -- >> Robin Becker >> _______________________________________________ >> python-win32 mailing list >> python-win32 at python.org >> https://mail.python.org/mailman/listinfo/python-win32 > > -- Robin Becker From david.hautbois at free.fr Fri May 13 06:24:02 2016 From: david.hautbois at free.fr (David Hautbois) Date: Fri, 13 May 2016 12:24:02 +0200 Subject: [python-win32] Python 3 - Windows Service Message-ID: <5735AB42.9020403@free.fr> Hi I passed all this week to get a Python Windows Service running. But, I failed.... I tried Windows 2003 and Windows 2012 R2. I installed python 3.4.4 x86 I installed pypiwin32 with pip : pip install pyinstaller I tried many sample scripts found on Google. I finally found sample scripts in C:\Python34\Lib\site-packages\win32\Demos\service I modified the servicesEvents.py script and simplified it : ________________________________________________________________________ import win32serviceutil, win32service import win32event, win32api import servicemanager import time import win32gui, win32gui_struct, win32con class EventDemoService(win32serviceutil.ServiceFramework): _svc_name_ = "PyServiceEventDemo" _svc_display_name_ = "Python Service Event Demo" _svc_description_ = "Demonstrates a Python service which takes advantage of the extra notifications" def __init__(self, args): win32serviceutil.ServiceFramework.__init__(self, args) self.hWaitStop = win32event.CreateEvent(None, 0, 0, None) self.running = True def SvcStop(self): self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) win32event.SetEvent(self.hWaitStop) self.running = False def SvcDoRun(self): self.ReportServiceStatus(win32service.SERVICE_RUNNING) while self.running: servicemanager.LogInfoMsg("aservice - is alive and well") time.sleep(3) def ctrlHandler(ctrlType): return True if __name__=='__main__': win32api.SetConsoleCtrlHandler(ctrlHandler, True) win32serviceutil.HandleCommandLine(EventDemoService) ________________________________________________________________________ I get a 2186 error when starting it with cmd : net start PyServiceEventDemo I get a 1053 error when starting it from the services manager. I get these errors with this sample and others found from a Google search. What is the status of Python3, pywin32 and Windows services ? Can I enabled some trace to understand the problem ? Could someone give me a working sample ? Could someone point me to some interesting links ? Thanks for your help ! David. From bgailer at gmail.com Fri May 13 09:46:01 2016 From: bgailer at gmail.com (Bob Gailer) Date: Fri, 13 May 2016 09:46:01 -0400 Subject: [python-win32] Python 3 - Windows Service In-Reply-To: <5735AB42.9020403@free.fr> References: <5735AB42.9020403@free.fr> Message-ID: On May 13, 2016 6:38 AM, "David Hautbois" wrote: > > Hi > > I passed all this week to get a Python Windows Service running. > But, I failed.... > > I tried Windows 2003 and Windows 2012 R2. > I installed python 3.4.4 x86 > > I installed pypiwin32 with pip : > pip install pyinstaller > > I tried many sample scripts found on Google. > I finally found sample scripts in C:\Python34\Lib\site-packages\win32\Demos\service > > I modified the servicesEvents.py script and simplified it : > ________________________________________________________________________ > import win32serviceutil, win32service > import win32event, win32api > import servicemanager > import time > > import win32gui, win32gui_struct, win32con > > class EventDemoService(win32serviceutil.ServiceFramework): > _svc_name_ = "PyServiceEventDemo" > _svc_display_name_ = "Python Service Event Demo" > _svc_description_ = "Demonstrates a Python service which takes advantage of the extra notifications" > > def __init__(self, args): > win32serviceutil.ServiceFramework.__init__(self, args) > self.hWaitStop = win32event.CreateEvent(None, 0, 0, None) > self.running = True > > def SvcStop(self): > self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) > win32event.SetEvent(self.hWaitStop) > self.running = False > > def SvcDoRun(self): > self.ReportServiceStatus(win32service.SERVICE_RUNNING) > while self.running: > servicemanager.LogInfoMsg("aservice - is alive and well") > time.sleep(3) > > def ctrlHandler(ctrlType): > return True > > if __name__=='__main__': > win32api.SetConsoleCtrlHandler(ctrlHandler, True) > win32serviceutil.HandleCommandLine(EventDemoService) > ________________________________________________________________________ > > I get a 2186 error when starting it with cmd : net start PyServiceEventDemo > I get a 1053 error when starting it from the services manager. We need to see the exact error messages and their contexts. Post as text since this list does not take attachments. > I get these errors with this sample and others found from a Google search. > > What is the status of Python3, pywin32 and Windows services ? > Can I enabled some trace to understand the problem ? > Could someone give me a working sample ? > Could someone point me to some interesting links ? > > Thanks for your help ! > > David. > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.hautbois at free.fr Fri May 13 10:02:26 2016 From: david.hautbois at free.fr (David Hautbois) Date: Fri, 13 May 2016 16:02:26 +0200 Subject: [python-win32] Python 3 - Windows Service In-Reply-To: References: <5735AB42.9020403@free.fr> Message-ID: <5735DE72.1060103@free.fr> Hi I received your empty message :) pywintypes34.dll was missing for pythonservice.exe. I copied the file in the same folder. It works ! I was using the powershell console, that does not display the error message about the missing file. cmd does. Now, I'm trying to build the binary exe file with pyinstaller. I get : C:\temp>dist\sample-pyinstaller.exe install Redirecting output to win32trace remote collector Failed to execute script sample-pyinstaller But this is another issue..... David. Le 13/05/2016 15:46, Bob Gailer a ?crit : > > > On May 13, 2016 6:38 AM, "David Hautbois" > wrote: > > > > Hi > > > > I passed all this week to get a Python Windows Service running. > > But, I failed.... > > > > I tried Windows 2003 and Windows 2012 R2. > > I installed python 3.4.4 x86 > > > > I installed pypiwin32 with pip : > > pip install pyinstaller > > > > I tried many sample scripts found on Google. > > I finally found sample scripts in > C:\Python34\Lib\site-packages\win32\Demos\service > > > > I modified the servicesEvents.py script and simplified it : > > ________________________________________________________________________ > > import win32serviceutil, win32service > > import win32event, win32api > > import servicemanager > > import time > > > > import win32gui, win32gui_struct, win32con > > > > class EventDemoService(win32serviceutil.ServiceFramework): > > _svc_name_ = "PyServiceEventDemo" > > _svc_display_name_ = "Python Service Event Demo" > > _svc_description_ = "Demonstrates a Python service which takes > advantage of the extra notifications" > > > > def __init__(self, args): > > win32serviceutil.ServiceFramework.__init__(self, args) > > self.hWaitStop = win32event.CreateEvent(None, 0, 0, None) > > self.running = True > > > > def SvcStop(self): > > self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) > > win32event.SetEvent(self.hWaitStop) > > self.running = False > > > > def SvcDoRun(self): > > self.ReportServiceStatus(win32service.SERVICE_RUNNING) > > while self.running: > > servicemanager.LogInfoMsg("aservice - is alive and well") > > time.sleep(3) > > > > def ctrlHandler(ctrlType): > > return True > > > > if __name__=='__main__': > > win32api.SetConsoleCtrlHandler(ctrlHandler, True) > > win32serviceutil.HandleCommandLine(EventDemoService) > > ________________________________________________________________________ > > > > I get a 2186 error when starting it with cmd : net start > PyServiceEventDemo > > I get a 1053 error when starting it from the services manager. > We need to see the exact error messages and their contexts. Post as > text since this list does not take attachments. > > I get these errors with this sample and others found from a Google > search. > > > > What is the status of Python3, pywin32 and Windows services ? > > Can I enabled some trace to understand the problem ? > > Could someone give me a working sample ? > > Could someone point me to some interesting links ? > > > > Thanks for your help ! > > > > David. > > _______________________________________________ > > python-win32 mailing list > > python-win32 at python.org > > https://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From T.J.Will at hotmail.com Mon May 23 19:10:17 2016 From: T.J.Will at hotmail.com (??) Date: Mon, 23 May 2016 23:10:17 +0000 Subject: [python-win32] AutoCAD attribute issue Message-ID: Hi Mark, Recently I'm working on the AutoCAD attribute extraction. When I install the pywin32 and write the code as follow: Before into the code, I want to ask one question. If I wish to extract from dxf file can I use the same method as below? -------------------------------------------------------------------------------------------- import win32com.client acad = win32com.client.Dispatch("AutoCAD.Application") ms = acad.ActiveDocument for entity in acad.ActiveDocument.ModelSpace: name = entity.EntityName if name == 'AcDbBlockReference': HasAttributes = entity.HasAttributes if HasAttributes: print(entity.Name) print(entity.Layer) print(entity.ObjectID) for attrib in entity.GetAttributes(): print("{}:{}".format(attrib.TagString, attrib.TextString)) attrib.TextString='modified with python' arrtib.Update() I encountered an error says : ==================== RESTART: F:\PHP\DXF_Data\Script4.py ==================== Traceback (most recent call last): File "E:\python3.5\lib\site-packages\win32com\client\dynamic.py", line 89, in _GetGoodDispatch IDispatch = pythoncom.connect(IDispatch) pywintypes.com_error: (-2147221005, 'invalid string', None, None) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "F:\PHP\DXF_Data\Script4.py", line 3, in acad = win32com.client.Dispatch("__**AutoCAD.Application") File "E:\python3.5\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx) File "E:\python3.5\lib\site-packages\win32com\client\dynamic.py", line 114, in _GetGoodDispatchAndUserName return (_GetGoodDispatch(IDispatch, clsctx), userName) File "E:\python3.5\lib\site-packages\win32com\client\dynamic.py", line 91, in _GetGoodDispatch IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch) pywintypes.com_error: (-2147221005, 'invalid string', None, None) >>> So I go back to the makeup.py to check if there is a autocad type library but I didn't found it. Can I get any suggestion from you? Best Regards, Will -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Mon May 23 21:28:35 2016 From: timr at probo.com (Tim Roberts) Date: Mon, 23 May 2016 18:28:35 -0700 Subject: [python-win32] AutoCAD attribute issue In-Reply-To: References: Message-ID: <1A0C824E-38D2-4471-83E1-423815A2403D@probo.com> On May 23, 2016, at 4:10 PM, ?? > wrote: Recently I?m working on the AutoCAD attribute extraction. When I install the pywin32 and write the code as follow: Before into the code, I want to ask one question. If I wish to extract from dxf file can I use the same method as below? -------------------------------------------------------------------------------------------- import win32com.client acad = win32com.client.Dispatch("AutoCAD.Application") ... Traceback (most recent call last): File "F:\PHP\DXF_Data\Script4.py", line 3, in acad = win32com.client.Dispatch("__**AutoCAD.Application?) So where did the __** come from? Those are, indeed, invalid characters in a COM CLSID name. ? Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From the.ubik at gmail.com Sun May 29 12:50:19 2016 From: the.ubik at gmail.com (Mr&Mrs D) Date: Sun, 29 May 2016 18:50:19 +0200 Subject: [python-win32] Is IFileSystemBindData in pywin32 ? Message-ID: Hi :) Using latest version from sourceforge ( pywin32-220.win32-py2.7.exe ) and trying to bend IFileOperation to my will - apparently if destination does not exist we must pass a context with a IFileSystemBindData object with the filename to stop windows from querying the file system for info on the non existing destination. See: http://stackoverflow.com/questions/18576103/shparsedisplayname-when-path-doesnt-exists But I can't seem to find any IID_IFileSystemBindData in shellcon ? Am I looking in the wrong place ? The code I am using to interface with IFileOperation is based on : https://github.com/frmdstryr/pywinutils/blob/master/winutils.py Thanks ! -------------- next part -------------- An HTML attachment was scrubbed... URL: