From robin at reportlab.com Wed Sep 2 12:14:47 2015 From: robin at reportlab.com (Robin Becker) Date: Wed, 2 Sep 2015 11:14:47 +0100 Subject: [python-win32] remote database changed causing odbc error Message-ID: <55E6CC17.8020309@chamonix.reportlab.co.uk> A user reports the following error dbi.internalError: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application in LOGIN. trying to connect to a new database source because they migrated the windows server to a new machine with a supported windows version. Apparently the sql server version changed from SQL Server version 2005 to 2012. The client machine is 64 bit with python 2.7, I am trying to determine the version of python +32/64 etc etc and the win32 extensions that are installed. Has anyone any advice on what the problem is here? -- Robin Becker From vernondcole at gmail.com Wed Sep 2 19:28:04 2015 From: vernondcole at gmail.com (Vernon D. Cole) Date: Wed, 2 Sep 2015 17:28:04 +0000 Subject: [python-win32] remote database changed causing odbc error In-Reply-To: <55E6CC17.8020309@chamonix.reportlab.co.uk> References: <55E6CC17.8020309@chamonix.reportlab.co.uk> Message-ID: There are two different modules which you might be using to connect to an SQL Server database. The odbc module is very basic, written in C, and follows the db-api version 1 api. The adodbapi module is more complex, written in Python, and follows the db-api version 2 specification (PEP 249, with many proposed "version 3" extensions). Unfortunately, due to my error, some parts of adodbapi are missing from the current release of pywin32, so you must install adodbapi separately from http://sourceforge.net/projects/adodbapi or from pypi . The separate download gives you more examples and documentation, and is necessary for Linux and IronPython users. Other than that, all pywin32 extensions are loaded together, if you have anything, you should have everything. Assuming that you are using a recent version of adodbapi... > >>> from adodbapi import is64bit > >>> is64bit.Python() > True > >>> is64bit.os() > True > >>> > I added these two functions as an aid for a programmer who is trying to automatically determine a working connection string, since 32 bit and 64 bit versions use different drivers. This is briefly discussed in the documentation, and complex working examples can be found in the test directory. A copy of the documentation is also at http://adodbapi.sourceforge.net/quick_reference.pdf. After a connection to the database has been established, you can determine the database engine and version you have been connected to... > import adodbapi > import adodbapi.is64bit as is64bit > > databasename = "test.mdb" > > if is64bit.Python(): > driver = "Microsoft.ACE.OLEDB.12.0" > else: > driver = "Microsoft.Jet.OLEDB.4.0" > constr = "Provider=%s;Data Source=%s" % (driver, databasename) > > #create the connection > con = adodbapi.connect(constr) > > print('dbms_name=', con.dbms_name, ' dbms_version=', con.dbms_version) > The above code is untested. I just "upgraded" to Windows 10, and it seems that the ACE driver is now broken. YMMV. -- Vernon Cole On Wed, Sep 2, 2015 at 10:14 AM, Robin Becker wrote: > A user reports the following error > > dbi.internalError: [Microsoft][ODBC Driver Manager] The specified DSN > contains > an architecture mismatch between the Driver and Application in LOGIN. > > trying to connect to a new database source because they migrated the > windows server to a new machine with a supported windows version. > Apparently the sql server version changed from SQL Server version 2005 to > 2012. > > The client machine is 64 bit with python 2.7, I am trying to determine the > version of python +32/64 etc etc and the win32 extensions that are > installed. > > Has anyone any advice on what the problem is here? > -- > 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 japie.amerika at gmail.com Sat Sep 5 01:58:16 2015 From: japie.amerika at gmail.com (Jannie Kakpraat) Date: Sat, 5 Sep 2015 01:58:16 +0200 Subject: [python-win32] SAPI COM server Message-ID: Hi, I'm trying to implement a SAPI com server in order to connect to a in-house developed TTS Engine. I have read chapter 5 and 12 of the book, but I am still struggling. My understanding is that I can load and register the sapi tbl file, and then just specify that my class is implementing the ISpTTSEngine and ISpObjectWithToken com interfaces as follows: _com_interfaces_ = ["ISpObjectWithToken", "ISpTTSEngine"] I have registered my server with a CLSID, but when I test it through SAPI it never even gets called. I tested my class through com client that I implemented and then it works fine. Can anybody please point me to what I'm missing. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From apilotti at cloudbasesolutions.com Sun Sep 6 18:19:07 2015 From: apilotti at cloudbasesolutions.com (Alessandro Pilotti) Date: Sun, 6 Sep 2015 16:19:07 +0000 Subject: [python-win32] pywin32 on Nano Server Message-ID: <9FB103C8-8524-46D4-ADBC-075631022873@cloudbasesolutions.com> Hi all, I?m getting some Python based projects to work on Microsoft Nano Server, in particular OpenStack Hyper-V / Windows componens and Cloudbase-Init / Cloud-Init for Windows. Python 3.4 x64 and Python 2.7 x64 currently work fine on Nano (Python 2.7 needs to be compiled targetting VS 2010 or above), but pywin32 required some work as Nano supports a significantly reduced API surface, although proxies called reverse forwarders are included to simplify porting of pre-existing applications. Failing to remove unavailable exports results in DLL loading failures (C000142 / C0000135 errors), as you?d expect. Here?s a fork of the pywin32 repository with Nano support, which works on the publicly availbale Nano server builds (e.g. Windows Server TP3). In particular here's the relevant patch: https://bitbucket.org/cloudbase/pywin32/commits/cae1b44e00195847312a4521ae6c5cca3bb5b195 The patch is quite coarse grained and is meant to provide a fully working PoC and not meant for merging at the current stage, as some cleanup and tests are needed, but it should give though an idea of the scope of work. Do you guys have already a plan around Nano support for pywin32? Thanks! Alessandro P.S.: The WMI module required a patch as well to work on Nano, due to the lack of COM monikers support: https://github.com/cloudbase/wmi/commit/e452f464f6c3c46d6ecbc973034738491996561a -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuchs.stefan at gmx.at Mon Sep 7 13:48:17 2015 From: fuchs.stefan at gmx.at (Stefan Fuchs) Date: Mon, 7 Sep 2015 13:48:17 +0200 Subject: [python-win32] adodbapi: Connection with 'WINCCOLEDBProvider.1' fails Message-ID: An HTML attachment was scrubbed... URL: From timr at probo.com Tue Sep 8 19:16:50 2015 From: timr at probo.com (Tim Roberts) Date: Tue, 8 Sep 2015 10:16:50 -0700 Subject: [python-win32] SAPI COM server In-Reply-To: References: Message-ID: <55EF1802.4070200@probo.com> Jannie Kakpraat wrote: > > I'm trying to implement a SAPI com server in order to connect to a > in-house developed TTS Engine. > I have read chapter 5 and 12 of the book, but I am still struggling. > My understanding is that I can > load and register the sapi tbl file, and then just specify that my > class is implementing the ISpTTSEngine and > ISpObjectWithToken com interfaces as follows: > > > _com_interfaces_ = ["ISpObjectWithToken", "ISpTTSEngine"] > > I have registered my server with a CLSID, but when I test it through > SAPI it never even gets called. I tested my class through com client > that I implemented and then it works fine. > Have you selected your engine as the default TTS engine in the Speech applet of Control Panel? -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From vernondcole at gmail.com Tue Sep 8 21:01:14 2015 From: vernondcole at gmail.com (Vernon D. Cole) Date: Tue, 8 Sep 2015 13:01:14 -0600 Subject: [python-win32] adodbapi: Connection with 'WINCCOLEDBProvider.1' fails In-Reply-To: References: Message-ID: On Mon, Sep 7, 2015 at 5:48 AM, Stefan Fuchs wrote: > 'WINCCOLEDBProvider.1' Your patch looks like the perfect answer. It has been included in the official source. -- Vernon Cole -------------- next part -------------- An HTML attachment was scrubbed... URL: From skippy.hammond at gmail.com Wed Sep 9 03:56:39 2015 From: skippy.hammond at gmail.com (Mark Hammond) Date: Wed, 9 Sep 2015 11:56:39 +1000 Subject: [python-win32] pywin32 on Nano Server In-Reply-To: <9FB103C8-8524-46D4-ADBC-075631022873@cloudbasesolutions.com> References: <9FB103C8-8524-46D4-ADBC-075631022873@cloudbasesolutions.com> Message-ID: <55EF91D7.2080300@gmail.com> On 7/09/2015 2:19 AM, Alessandro Pilotti wrote: > Hi all, > > I?m getting some Python based projects to work on Microsoft Nano Server, > in particular OpenStack Hyper-V / Windows componens and Cloudbase-Init / > Cloud-Init for Windows. > > Python 3.4 x64 and Python 2.7 x64 currently work fine on Nano (Python > 2.7 needs to be compiled targetting VS 2010 or above), but pywin32 > required some work as Nano supports a significantly reduced API surface, > although proxies called reverse forwarders are included to simplify > porting of pre-existing applications. > > Failing to remove unavailable exports results in DLL loading failures > (C000142 / C0000135 errors), as you?d expect. > > Here?s a fork of the pywin32 repository with Nano support, which works > on the publicly availbale Nano server builds (e.g. Windows Server TP3). > In particular here's the relevant patch: > https://bitbucket.org/cloudbase/pywin32/commits/cae1b44e00195847312a4521ae6c5cca3bb5b195 > > The patch is quite coarse grained and is meant to provide a fully > working PoC and not meant for merging at the current stage, as some > cleanup and tests are needed, but it should give though an idea of the > scope of work. That looks fine, although a consideration will be packaging - it appears to mean there will need to be twice as many packages built, and the potential for confusion by users who have no idea what a "nano" build is and whether they want that. Another alternative (that is probably not viable) may be to build a (many?) "stub" DLL(s) that throws errors and is conditionally loaded, thus allowing the same distribution (but with reduced functionality) to be used on nano. TBH though, I'd be fine with a patch such as you provided with an eye to a better solution in the future - but I'm not sure I can commit to making nano-specific builds for every current build. That might mean people wanting a nano build need to make one themselves, but at least they will be able to do so without modifying the source. (Also note that the .cpp files in pywin32 tend to use tabs rather than spaces (hysterical raisins) , but your patch is using spaces) > Do you guys have already a plan around Nano support for pywin32? Nope - it sounds like you are helping make one though ;) Thanks! Mark From japie.amerika at gmail.com Wed Sep 16 12:35:32 2015 From: japie.amerika at gmail.com (Jannie Kakpraat) Date: Wed, 16 Sep 2015 12:35:32 +0200 Subject: [python-win32] SAPI COM server In-Reply-To: <55EF1802.4070200@probo.com> References: <55EF1802.4070200@probo.com> Message-ID: Well no. I select a voice that I have registered in the registry that points to the CLSID of the python win32com dll loader, which to my understanding should then load my class. That is the way I understand SAPI works and how I got it to work with my C implementation. My class as is can be seen on pastebin here: http://pastebin.com/MeEMycp4 On Tue, Sep 8, 2015 at 7:16 PM, Tim Roberts wrote: > Jannie Kakpraat wrote: > > > > I'm trying to implement a SAPI com server in order to connect to a > > in-house developed TTS Engine. > > I have read chapter 5 and 12 of the book, but I am still struggling. > > My understanding is that I can > > load and register the sapi tbl file, and then just specify that my > > class is implementing the ISpTTSEngine and > > ISpObjectWithToken com interfaces as follows: > > > > > > _com_interfaces_ = ["ISpObjectWithToken", "ISpTTSEngine"] > > > > I have registered my server with a CLSID, but when I test it through > > SAPI it never even gets called. I tested my class through com client > > that I implemented and then it works fine. > > > > Have you selected your engine as the default TTS engine in the Speech > applet of Control Panel? > > -- > Tim Roberts, timr at probo.com > Providenza & Boekelheide, Inc. > > _______________________________________________ > 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 samil.nart at gmail.com Tue Sep 22 15:38:42 2015 From: samil.nart at gmail.com (samilnart .) Date: Tue, 22 Sep 2015 16:38:42 +0300 Subject: [python-win32] Task Scheduler on Windows 7 and pythonw.exe problems Message-ID: So when i launch my script on command line using pythonw it works fine but if task scheduler launches it, it instantly crashes without error message. Here is the code: http://pastebin.com/5QfmMrPN . Any help is appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Tue Sep 22 20:14:00 2015 From: timr at probo.com (Tim Roberts) Date: Tue, 22 Sep 2015 11:14:00 -0700 Subject: [python-win32] Task Scheduler on Windows 7 and pythonw.exe problems In-Reply-To: References: Message-ID: <56019A68.8060401@probo.com> samilnart . wrote: > So when i launch my script on command line using pythonw it works fine > but if task scheduler launches it, it instantly crashes without error > message. Here is the code: http://pastebin.com/5QfmMrPN . Any help is > appreciated. What user did you use to create your scheduled task? Is it running as you? You might consider using the subprocess module to start your netsh commands instead of os.system. os.system is going to want to create a subshell, but processes running in a service (which scheduled tasks do) aren't allowed to interact with the desktop. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From eryksun at gmail.com Wed Sep 23 00:42:53 2015 From: eryksun at gmail.com (eryksun) Date: Tue, 22 Sep 2015 17:42:53 -0500 Subject: [python-win32] Task Scheduler on Windows 7 and pythonw.exe problems In-Reply-To: <56019A68.8060401@probo.com> References: <56019A68.8060401@probo.com> Message-ID: On 9/22/15, Tim Roberts wrote: > samilnart . wrote: >> So when i launch my script on command line using pythonw it works fine >> but if task scheduler launches it, it instantly crashes without error >> message. Here is the code: http://pastebin.com/5QfmMrPN . Any help is >> appreciated. > > What user did you use to create your scheduled task? Is it running as you? I'll hazard a guess that the script is being run as a regular user, or as a non-elevated administrator (i.e. without configuring the task to "run with highest privileges). In this case the netsh command will fail. > You might consider using the subprocess module to start your netsh > commands instead of os.system. os.system is going to want to create a > subshell, but processes running in a service (which scheduled tasks do) > aren't allowed to interact with the desktop. A console process, such as cmd.exe, doesn't care about creating a window. That's the job of the console host process, conhost.exe, which is actually designed to allow running without a window (i.e. the process creation flag CREATE_NO_WINDOW). I run cmd.exe in session 0 all the time via KpyM SSH. That spawns a "session.exe" console process in session 0 that defaults to running a cmd shell. But let's verify that running netsh via cmd actually works when scheduled as a task that runs in session 0. I'll run as SYSTEM, since I know the task engine uses session 0 in this case. C:\> schtasks /create /tn firewall_options ^ More? /ru system /sc once /sd 01/01/1900 /st 00:00 /tr ^ More? "cmd /c 'netsh firewall /? ^> C:\firewall.txt'" WARNING: Task may not run because /ST is earlier than current time. SUCCESS: The scheduled task "firewall_options" has successfully been created. C:\>schtasks /run /tn firewall_options SUCCESS: Attempted to run the scheduled task "firewall_options". C:\>type firewall.txt The following commands are available: Commands in this context: ? - Displays a list of commands. add - Adds firewall configuration. delete - Deletes firewall configuration. dump - Displays a configuration script. help - Displays a list of commands. set - Sets firewall configuration. show - Shows firewall configuration. To view help for a command, type the command, followed by a space, and then type ?. It works! The script could redirect cmd's stdout and stderr to a log file, as I did with stdout in the above example. For example: os.system(r'"netsh advfirewall set currentprofile state on > "%TEMP%\netsh.log" 2>&1"') From appleinformatics at yahoo.com Thu Sep 24 10:48:49 2015 From: appleinformatics at yahoo.com (Apple Informatics) Date: Thu, 24 Sep 2015 08:48:49 +0000 (UTC) Subject: [python-win32] PYTHON DEVELOPER with 3+ years Exp. ( Job Location : Hyderabad ) In-Reply-To: <1004659338.302671.1443000621340.JavaMail.yahoo@mail.yahoo.com> References: <580653131.868494.1442489145636.JavaMail.yahoo@mail.yahoo.com> <1437621819.1470631.1442936124978.JavaMail.yahoo@mail.yahoo.com> <581038898.1454478.1442936199226.JavaMail.yahoo@mail.yahoo.com> <205672116.1469669.1442936874553.JavaMail.yahoo@mail.yahoo.com> <1024218982.1466800.1442937467147.JavaMail.yahoo@mail.yahoo.com> <731329813.1466639.1442937526016.JavaMail.yahoo@mail.yahoo.com> <413663562.1465510.1442937630998.JavaMail.yahoo@mail.yahoo.com> <1209352899.1467325.1442937738289.JavaMail.yahoo@mail.yahoo.com> <457186239.1496916.1442946941570.JavaMail.yahoo@mail.yahoo.com> <1003613989.1502190.1442947621827.JavaMail.yahoo@mail.yahoo.com> <1314024982.297615.1442998668894.JavaMail.yahoo@mail.yahoo.com> <34447859.297404.1442999357012.JavaMail.yahoo@mail.yahoo.com> <493700817.295072.1442999661670.JavaMail.yahoo@mail.yahoo.com> <1566958952.299848.1442999896244.JavaMail.yahoo@mail.yahoo.com> <2055371674.308516.1443000262601.JavaMail.yahoo@mail.yahoo.com> <1004659338.302671.1443000621340.JavaMail.yahoo@mail.yahoo.com> Message-ID: <74931850.196848.1443084529646.JavaMail.yahoo@mail.yahoo.com> Hi ?We are looking for a?PYTHON DEVELOPER??with ?3+ years Exp.???????????????????????Strong in Python??????????Django framework??????????Good at Rest API??????????Decent communication skills??????????3+ Years? experience??????????Full time ? Immediate Joinee?? ? ? ? ? ?Job Location : Hyderabad?Please send your profile to?appleinformatics at yahoo.com? along with below detailsFull Name:Total Exp:Relevant Exp:CTC:ECTC:Notice Period:Are you available immediately for the position?Current Location:Open to relocate to Hyderabad:??Thanks & Regards K.Seshagirirao? Manager-Operations Apple Informatics www.appleinformatics.com 040-65144951,9000611370 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Denis.Akhiyarov at woodgroupkenny.com Wed Sep 30 17:07:53 2015 From: Denis.Akhiyarov at woodgroupkenny.com (AKHIYAROV, Denis (WGK)) Date: Wed, 30 Sep 2015 15:07:53 +0000 Subject: [python-win32] comtypes cryptic error - no attribute '__ctypes_from_outparam__' Message-ID: <3325F0E4B832144293520141988AFFA841B3CD83@WP-EX-MBX-01.WOODGROUP.com> Hello pywin32 users and developers, I?m generally pretty happy about using COM through comtypes, but get this cryptic error below. https://github.com/enthought/comtypes/issues/87 http://stackoverflow.com/questions/32869070/comtypes-com-objects-method-returns-tuple-object-has-no-attribute-ctypes I'm invoking a method of COM object with string argument using comtypes and method returns (it should return a COM string): --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in () ----> 1 obj1=xobjData.GetDataType('string_name') C:\Python\Python27\lib\site-packages\comtypes\__init__.pyc in call_with_inout(self_, *args, **kw) 657 # be iterable. 658 if len(outargs) == 1: # rescode is not iterable --> 659 return rescode.__ctypes_from_outparam__() 660 661 rescode = list(rescode) AttributeError: 'tuple' object has no attribute '__ctypes_from_outparam__' Seems very cryptic error, any help? %debug magic shows following: > c:\python\python27\lib\site-packages\comtypes\__init__.py(659)call_with_inout() 658 if len(outargs) == 1: # rescode is not iterable --> 659 return rescode.__ctypes_from_outparam__() 660 ipdb> outargs {0: VARIANT(vt=0x8, u'string_name')} ipdb> rescode (VARIANT(vt=0x8, u'string_name'), u'Long') ipdb> exit Denis Tauzikhovich Akhiyarov, Senior Consultant 15115 Park Row - Suite 250 Houston, Texas 77084 +1. 281.600.3685 (Direct) +1. 918.200.3994 (Mobile) +1. 281.646.1515 (Switchboard) Denis.Akhiyarov at woodgroupkenny.com www.msikenny.com www.woodgroupkenny.com [cid:image002.png at 01CF28A3.5A0DAE20] Please consider the environment before printing this email. This email and its attachments may contain information which is confidential and/or legally privileged. If you are not the intended recipient of this e-mail please notify the sender immediately by e-mail and delete this e-mail and its attachments from your computer and IT systems. You must not copy, re-transmit, use or disclose (other than to the sender) the existence or contents of this e-mail or its attachments or permit anyone else to do so. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 38486 bytes Desc: image001.png URL: