From mauro.b.mail at gmail.com Tue Nov 1 16:22:41 2011 From: mauro.b.mail at gmail.com (m b) Date: Tue, 1 Nov 2011 15:22:41 +0000 Subject: [python-win32] DCOM - Client machine without Python installation Message-ID: Hello, I successfully created some COM objects and I am using them through Excel on a single machine. I would like to leave the code (and python) on a server machine, and run the code from Excel on some client machines with no Python installation. Is it possible? If yes, how can I register the COM objects on the client machines if I do not have win32com installed? Thank you, Mauro -------------- next part -------------- An HTML attachment was scrubbed... URL: From matteo.boscolo at boscolini.eu Wed Nov 2 11:12:58 2011 From: matteo.boscolo at boscolini.eu (Matteo Boscolo) Date: Wed, 02 Nov 2011 11:12:58 +0100 Subject: [python-win32] DCOM - Client machine without Python installation In-Reply-To: References: Message-ID: <4EB117AA.8060606@boscolini.eu> I think that you have to compile it with py2exe and install it on the client machine regards, Matteo Il 01/11/2011 16:22, m b ha scritto: > Hello, > I successfully created some COM objects and I am using them through > Excel on a single machine. > I would like to leave the code (and python) on a server machine, and > run the code from Excel on some client machines with no Python > installation. Is it possible? If yes, how can I register the COM > objects on the client machines if I do not have win32com installed? > Thank you, > Mauro > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 -------------- next part -------------- An HTML attachment was scrubbed... URL: From kris at rhs.com Sat Nov 5 04:57:29 2011 From: kris at rhs.com (Kris Hardy) Date: Fri, 04 Nov 2011 21:57:29 -0600 Subject: [python-win32] Full LOGFONT implementation Message-ID: <4EB4B429.1040509@rhs.com> All, I ran into an issue with the LOGFONT struct implementation which was not allowing me to set a few font options that I needed for an app I wrote. The problem was that the full LOGFONT struct had not been implemented. I have what seems to be a working patch, but I would like a sanity check from someone with more experience with pywin32 than I. 1) Is there an automated unit test somewhere where I can check my patch for regressions? I didn't see one, but I'm brand new to pywin32. 2) Does anyone expect any consequences of this patch? The patches are attached to the feature request on SF: https://sourceforge.net/tracker/?func=detail&aid=3433757&group_id=78018&atid=551957 (Sorry for the 2 patches. I've only used hg for 2 days and haven't figured out how to flatten changesets yet...) Thanks! -Kris From skippy.hammond at gmail.com Sat Nov 5 06:26:24 2011 From: skippy.hammond at gmail.com (Mark Hammond) Date: Sat, 05 Nov 2011 16:26:24 +1100 Subject: [python-win32] Full LOGFONT implementation In-Reply-To: <4EB4B429.1040509@rhs.com> References: <4EB4B429.1040509@rhs.com> Message-ID: <4EB4C900.7020908@gmail.com> On 5/11/2011 2:57 PM, Kris Hardy wrote: > All, > > I ran into an issue with the LOGFONT struct implementation which was not > allowing me to set a few font options that I needed for an app I wrote. > The problem was that the full LOGFONT struct had not been implemented. I > have what seems to be a working patch, but I would like a sanity check > from someone with more experience with pywin32 than I. > > 1) Is there an automated unit test somewhere where I can check my patch > for regressions? I didn't see one, but I'm brand new to pywin32. > > 2) Does anyone expect any consequences of this patch? > > The patches are attached to the feature request on SF: > > https://sourceforge.net/tracker/?func=detail&aid=3433757&group_id=78018&atid=551957 I think the patches look fine (with some tweaks I requested on the issue) and I just pushed the changes.. Pythonwin sadly has fairly limited tests. Cheers, Mark > > > (Sorry for the 2 patches. I've only used hg for 2 days and haven't > figured out how to flatten changesets yet...) > > Thanks! > > -Kris > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 From mc at mclaveau.com Sun Nov 6 13:33:41 2011 From: mc at mclaveau.com (Michel Claveau) Date: Sun, 6 Nov 2011 13:33:41 +0100 Subject: [python-win32] (no subject) Message-ID: <124520DAEC7F431FB25C69CEF3E9D8F5@M14> Hi! In win32con, I do not found this constant: FILE_ATTRIBUTE_REPARSE_POINT = 1024 # 0x400 Exemple of use: import ctypes rep=u"C:\\web\\fichiers" FILE_ATTRIBUTE_REPARSE_POINT = 1024 # 0x400 vret = ctypes.windll.kernel32.GetFileAttributesW(rep) if vret & FILE_ATTRIBUTE_REPARSE_POINT: print "JUNCTION" else: print "REPertoire" is it possible to add it (in next version of) Pywin32? @-salutations -- Michel Claveau -------------- next part -------------- An HTML attachment was scrubbed... URL: From skippy.hammond at gmail.com Sun Nov 6 23:06:51 2011 From: skippy.hammond at gmail.com (Mark Hammond) Date: Mon, 07 Nov 2011 09:06:51 +1100 Subject: [python-win32] (no subject) In-Reply-To: <124520DAEC7F431FB25C69CEF3E9D8F5@M14> References: <124520DAEC7F431FB25C69CEF3E9D8F5@M14> Message-ID: <4EB704FB.6030806@gmail.com> On 6/11/2011 11:33 PM, Michel Claveau wrote: > Hi! > In win32con, I do not found this constant: FILE_ATTRIBUTE_REPARSE_POINT > = 1024 # 0x400 > Exemple of use: > import ctypes > rep=u"C:\\web\\fichiers" > FILE_ATTRIBUTE_REPARSE_POINT = 1024 # 0x400 > vret = ctypes.windll.kernel32.GetFileAttributesW(rep) > if vret & FILE_ATTRIBUTE_REPARSE_POINT: > print "JUNCTION" > else: > print "REPertoire" > > is it possible to add it (in next version of) Pywin32? Yep - it is already in source control. Mark From kxroberto at googlemail.com Sun Nov 6 23:35:04 2011 From: kxroberto at googlemail.com (Robert) Date: Sun, 06 Nov 2011 23:35:04 +0100 Subject: [python-win32] can't import dde module after importing win32ui In-Reply-To: <4DF22612.406@gmail.com> References: <1300898289.2808.8.camel@florete.mza.com> <4DF22612.406@gmail.com> Message-ID: Mark Hammond wrote: > On 7/06/2011 9:11 PM, nekolyanich wrote: >> Michel Claveau mclaveau.com> writes: >> >>> >>> Hi! >>> >>> I have also/another problem with win32ui in 216 version: on >>> several COM's >>> servers, if the line >>> import win32ui >>> is present, servers can not be contacted. >>> If I comment the line, no more problem. Uncomment, problem is >>> coming back. >>> >>> Waiting a solution, I come back to 214. >>> >>> @-salutations >> >> Saw this bug, and 214 version helped me with my 32-bit xp. But >> in production i'd >> have 64-bit mashine, and downgrading to 214 version don't helps. >> Any ideas, how >> to make it work? > > It will be something to do with the manifest and the mfc > libraries. I think that even though the mfc dlls are installed > with pywin32, it might not work as hoped :) Can you find a > redistributable version of the MFC dlls you can try? I can't > explain why the 32 vs 64bit versions behave differently other than > what libraries are already installed. > > Sorry, not much help... > same problem here. Well, the problem seems not to be 64bit specific. But is with build 216 and 215 on 32bit as well; and with all Python versions. Something changed critically with 215 build. The problem is not when starting through Pythinwin.exe (IDE), but only when starting with python(w).exe + win32ui (Even when the Pythonwin IDE is raise sucessfully through a script on python(w).exe, the problem is there) Is there a special manifest in Pythonwin.exe ? Robert From kxroberto at googlemail.com Mon Nov 7 00:14:08 2011 From: kxroberto at googlemail.com (Robert) Date: Mon, 07 Nov 2011 00:14:08 +0100 Subject: [python-win32] can't import dde module after importing win32ui In-Reply-To: References: <1300898289.2808.8.camel@florete.mza.com> <4DF22612.406@gmail.com> Message-ID: Robert wrote: > Mark Hammond wrote: >> >> It will be something to do with the manifest and the mfc >> libraries. I think that even though the mfc dlls are installed >> with pywin32, it might not work as hoped :) Can you find a >> redistributable version of the MFC dlls you can try? I can't >> explain why the 32 vs 64bit versions behave differently other than >> what libraries are already installed. >> >> Sorry, not much help... >> > > same problem here. > > Well, the problem seems not to be 64bit specific. But is with > build 216 and 215 on 32bit as well; and with all Python versions. > Something changed critically with 215 build. > > The problem is not when starting through Pythinwin.exe (IDE), but > only when starting with python(w).exe + win32ui > (Even when the Pythonwin IDE is raise sucessfully through a script > on python(w).exe, the problem is there) > > Is there a special manifest in Pythonwin.exe ? > notized: I remove just mfc90.dll from the Pythonwin folder, and then do python.exe: C:\Python26\Lib\site-packages\pythonwin>\python26\python Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import win32ui >>> win32ui.GetApp() object 'PyCWinApp' - assoc is 00BBC728, vi=, notify=0,ch/u=0/0 >>> import dde Traceback (most recent call last): File "", line 1, in ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden. (module not found) >>> => dde relies on the mfc90.dll in the same folder, but win32ui(.GetApp()) not !? And: with that removed mfc90.dll I can yet start the Pythonwin.exe of that very same folder AND successfully import dde !: PythonWin 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] on win32. Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for further copyright information. >>> import dde >>> os.getcwd() 'C:\\Python26\\Lib\\site-packages\\pythonwin' >>> dde >>> => This time starting through Pythonwin.exe the same dde.pyd doesn't require the mfc90.dll in that folder! (I can even remove the other 3 mfc dlls too) => There is a strange mixup of mfc DLL dependencies, varying with the initial .exe There are also 2 different dates of the 4 MFC dlls here (in a very strange cross over order): 26.02.2011 18:43 48.640 dde.pyd 04.11.2011 11:57 1.156.600 mfc90.dll 07.11.2007 02:19 1.162.744 mfc90u.dll 06.11.2007 23:51 59.904 mfcm90.dll 04.11.2011 11:57 59.904 mfcm90u.dll 04.11.2011 11:57 548 Microsoft.VC90.MFC.manifest 19.08.2010 14:56 354.304 pythoncom26.dll 26.02.2011 18:43 19.968 Pythonwin.exe 19.08.2010 14:56 110.592 pywintypes26.dll 26.02.2011 18:42 778.240 win32ui.pyd 26.02.2011 18:42 37.888 win32uiole.pyd 11 Datei(en) 3.789.332 Bytes 2 Verzeichnis(se), 43.639.382.016 Bytes frei I tried to copy various mfc90 DLL's (4 of same date; e.g. 18.4.2011) from WinSxS and also from pythonwin-212 to the 216 pythonwin folder , but that still didn't solve the dde import problem in 216 when starting through python(w).exe any ideas? Robert From kxroberto at googlemail.com Mon Nov 7 01:28:19 2011 From: kxroberto at googlemail.com (Robert) Date: Mon, 07 Nov 2011 01:28:19 +0100 Subject: [python-win32] can't import dde module after importing win32ui In-Reply-To: References: <1300898289.2808.8.camel@florete.mza.com> <4DF22612.406@gmail.com> Message-ID: Robert wrote: > Robert wrote: >> Mark Hammond wrote: >>> >>> It will be something to do with the manifest and the mfc >>> libraries. I think that even though the mfc dlls are installed >>> with pywin32, it might not work as hoped :) Can you find a >>> redistributable version of the MFC dlls you can try? I can't >>> explain why the 32 vs 64bit versions behave differently other than >>> what libraries are already installed. >>> >>> Sorry, not much help... >>> >> >> same problem here. >> >> Well, the problem seems not to be 64bit specific. But is with >> build 216 and 215 on 32bit as well; and with all Python versions. >> Something changed critically with 215 build. >> >> The problem is not when starting through Pythinwin.exe (IDE), but >> only when starting with python(w).exe + win32ui >> (Even when the Pythonwin IDE is raise sucessfully through a script >> on python(w).exe, the problem is there) >> >> Is there a special manifest in Pythonwin.exe ? >> > > > notized: I remove just mfc90.dll from the Pythonwin folder, and > then do python.exe: > > C:\Python26\Lib\site-packages\pythonwin>\python26\python > Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 > bit (Intel)] on win32 > Type "help", "copyright", "credits" or "license" for more > information. > >>> import win32ui > >>> win32ui.GetApp() > object 'PyCWinApp' - assoc is 00BBC728, vi=, notify=0,ch/u=0/0 > >>> import dde > Traceback (most recent call last): > File "", line 1, in > ImportError: DLL load failed: Das angegebene Modul wurde nicht > gefunden. (module not found) > >>> > > > => dde relies on the mfc90.dll in the same folder, but > win32ui(.GetApp()) not !? > > > And: with that removed mfc90.dll I can yet start the Pythonwin.exe > of that very same folder AND successfully import dde !: > PythonWin 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 > bit (Intel)] on win32. > Portions Copyright 1994-2008 Mark Hammond - see 'Help/About > PythonWin' for further copyright information. > >>> import dde > >>> os.getcwd() > 'C:\\Python26\\Lib\\site-packages\\pythonwin' > >>> dde > > >>> > > > => This time starting through Pythonwin.exe the same dde.pyd > doesn't require the mfc90.dll in that folder! (I can even remove > the other 3 mfc dlls too) > > => There is a strange mixup of mfc DLL dependencies, varying with > the initial .exe > > There are also 2 different dates of the 4 MFC dlls here (in a very > strange cross over order): > > 26.02.2011 18:43 48.640 dde.pyd > 04.11.2011 11:57 1.156.600 mfc90.dll > 07.11.2007 02:19 1.162.744 mfc90u.dll > 06.11.2007 23:51 59.904 mfcm90.dll > 04.11.2011 11:57 59.904 mfcm90u.dll > 04.11.2011 11:57 548 Microsoft.VC90.MFC.manifest > 19.08.2010 14:56 354.304 pythoncom26.dll > 26.02.2011 18:43 19.968 Pythonwin.exe > 19.08.2010 14:56 110.592 pywintypes26.dll > 26.02.2011 18:42 778.240 win32ui.pyd > 26.02.2011 18:42 37.888 win32uiole.pyd > 11 Datei(en) 3.789.332 Bytes > 2 Verzeichnis(se), 43.639.382.016 Bytes frei > > > I tried to copy various mfc90 DLL's (4 of same date; e.g. > 18.4.2011) from WinSxS and also from pythonwin-212 to the 216 > pythonwin folder , but that still didn't solve the dde import > problem in 216 when starting through python(w).exe > > any ideas? > > now I extracted the manifest from Pythonwin.exe with win32api.LoadResource(None, 24, 1) and saved it as python.exe.manifest (or myapp.exe.manifest) next to the used python.exe (-> see attachment) and then "import win32ui, dde" works with that python.exe ! Seen in 216: * win32ui.pyd has a internal manifest (extracted in attachment: contains only the MFC section) * dde.pyd doesn't have a internal manifest! In the pythonwin folder there is a Microsoft.VC90.MFC.manifest with matching version, though the local MFC DLLs and manifest seem not to be used at all now with that python.exe.manifest. and never were used with Pythonwin.exe. So how does this sort out? and how to explain this? Which MFC / manifest files should be packaged with a win32ui application binary. (py2exe doesn't collect that right directly) Robert PS: in C:\python26 is a update_manifest.py which adds a "Microsoft.Windows.Common-Controls" section to a local python.exe.manifest. Don't know if this is from 2.6.6 or from earlier python 2.6 versions, because the file is rather old. name="Microsoft.Windows.Common-Controls" version="6.0.0.0" well, what actually does this do? the presence of this manifest file/section makes a win32ui app look strange (background of labels etc.), and fatal: auto-magical button pressing is going on everywhere as soon as you move the mouse over a button or even without! what is this? (I've seen with a debug print: the HookCommand'ed handlers in those win32ui apps are called with strange big command notification codes - while true commands upon e.g. button pressing have a notification code of 0) -------------- next part -------------- A non-text attachment was scrubbed... Name: python.exe.manifest Type: text/xml Size: 958 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: win32ui.pyd.manifest Type: text/xml Size: 746 bytes Desc: not available URL: From kxroberto at googlemail.com Mon Nov 7 15:28:45 2011 From: kxroberto at googlemail.com (Robert) Date: Mon, 07 Nov 2011 15:28:45 +0100 Subject: [python-win32] WinSxS, manifests and binary distribution ? Message-ID: Hello, I want to see clearly which MFC DLLs (and VCR DLLs) pythonwin.exe or python(w).exe +win32ui.dll are actually using in Python2.6 or 2.7. And how to manage the actuall bindings/dependencies. And how to put together binary distribution files. I want to find a way to first move away the MFC DLLs, to have a situation here like on a computer without Python installed. And then put (& test) precisely the required DLLs/manifests next to a myapp.exe (win32ui based), so that I find which and how how files can be distributed. But the situation seems weired so far: Python2.7.2 / pywin 216: Verzeichnis von C:\Python27\Lib\site-packages\pythonwin 07.11.2011 14:44 . 07.11.2011 14:44 .. 26.02.2011 19:10 48.640 dde.pyd 11.06.2008 13:02 1.550 license.txt 07.11.2007 03:19 1.156.600 mfc90.dll 07.11.2007 03:19 1.162.744 mfc90u.dll 07.11.2007 00:51 59.904 mfcm90.dll 07.11.2007 00:51 59.904 mfcm90u.dll 07.11.2007 00:51 548 Microsoft.VC90.MFC.manifest 26.02.2011 19:10 19.968 Pythonwin.exe 04.11.2011 19:07 pywin 26.02.2011 19:11 416.256 scintilla.dll 06.11.2011 23:12 1.446 startframework.pyw 26.02.2011 19:09 778.240 win32ui.pyd 26.02.2011 19:10 37.888 win32uiole.pyd 07.11.2011 14:44 _mv 12 Datei(en) 3.743.688 Bytes 4 Verzeichnis(se), 43.545.804.800 Bytes frei Now when I move away the 5 MFC files (4 dlls + manifest) to _mv, then Pythonwin.exe still runs properly! And it does so until I move the folder C:\WINDOWS\WinSxS\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_028bc148 away to C:\WINDOWS\WinSxS\_mv (There are 2 more 9.0 MFC folders in WinSxS, but they have no effect regarding Pythonwin.exe - on or off) Well, but Pythonwin.exe has a builtin manifest (win32api.LoadResource(None, 24, 1)) which draws version="9.0.21022.8" - and not 9.0.30729.* !? how come? : Moreover, the files in .. Verzeichnis von C:\WINDOWS\WinSxS\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_028bc 148 10.10.2011 11:04 . 10.10.2011 11:04 .. 18.04.2011 21:51 3.766.600 mfc90.dll 18.04.2011 21:51 3.781.960 mfc90u.dll 18.04.2011 21:51 59.904 mfcm90.dll 18.04.2011 21:51 59.904 mfcm90u.dll 4 Datei(en) 7.668.368 Bytes 2 Verzeichnis(se), 43.545.792.512 Bytes frei .. are younger than Pythonwin.exe itself !?? Well, now with MFC90 folders of WinSxS moved away, and Pythonwin.exe finally not booting as wanted, I move then back the 5 MFC files from C:\Python27\Lib\site-packages\pythonwin\_mv to C:\Python27\Lib\site-packages\pythonwin . But Pythowin.exe now doesn't start with that files right next to it (where precisely the same version is in Pythonwin.exe manifest and in that Microsoft.VC90.MFC.manifest file), nor does import win32ui in python(w).exe work. (ImportError: DLL load failed: The referenced assembly is not installed on the computer) Pythonwin.exe or win32ui won't load until C:\WINDOWS\WinSxS\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_028bc 148 is in Place. I absolutely don't understand this. How can Pythonwin.exe draw a MFC90 DLL set with future date and future version, and reject the DLL set coming with pywin32 installer right next to with right version ... ? What has to be done to distribute the right binary files for a win32ui app? Where do the "active" rather new files in C:\WINDOWS\WinSxS\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_028bc 148 come from at all? Robert PS: By experience the method with placing MSVCRT 90 files + manifest next to a Python2.6 wxPython app (no MFC/win32ui) worked on fresh computers (which I don't have easily at hand). But here c:\python27\python.exe requires C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_31a54e43 .. while 'name="Microsoft.VC90.CRT" version="9.0.21022.8"' is in its built-in manifest From skippy.hammond at gmail.com Tue Nov 8 06:02:50 2011 From: skippy.hammond at gmail.com (Mark Hammond) Date: Tue, 08 Nov 2011 16:02:50 +1100 Subject: [python-win32] WinSxS, manifests and binary distribution ? In-Reply-To: References: Message-ID: <4EB8B7FA.7070207@gmail.com> I'm afraid some of the assembly stuff is truly black-magic to me, but I'll answer what I can. On 8/11/2011 1:28 AM, Robert wrote: ... > > Now when I move away the 5 MFC files (4 dlls + manifest) to _mv, then > Pythonwin.exe still runs properly! > And it does so until I move the folder > C:\WINDOWS\WinSxS\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_028bc148 > away to C:\WINDOWS\WinSxS\_mv > > (There are 2 more 9.0 MFC folders in WinSxS, but they have no effect > regarding Pythonwin.exe - on or off) > > Well, but Pythonwin.exe has a builtin manifest > (win32api.LoadResource(None, 24, 1)) which draws version="9.0.21022.8" - > and not 9.0.30729.* !? how come? : How come what? The C compiler generates this dependency based on what I have installed, which is VS2008 with no service packs. > > > > > > > uiAccess="false"> > > > > > > version="9.0.21022.8" processorArchitecture="x86" > publicKeyToken="1fc8b3b9a1e18e3b"> > > > > > version="9.0.21022.8" processorArchitecture="x86" > publicKeyToken="1fc8b3b9a1e18e3b"> > > > > > > Moreover, the files in .. > > Verzeichnis von > C:\WINDOWS\WinSxS\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_028bc > > 148 > > 10.10.2011 11:04 . > 10.10.2011 11:04 .. > 18.04.2011 21:51 3.766.600 mfc90.dll > 18.04.2011 21:51 3.781.960 mfc90u.dll > 18.04.2011 21:51 59.904 mfcm90.dll > 18.04.2011 21:51 59.904 mfcm90u.dll > 4 Datei(en) 7.668.368 Bytes > 2 Verzeichnis(se), 43.545.792.512 Bytes frei > > .. are younger than Pythonwin.exe itself !?? I guess the manifest for that version indicates it supports the older version? > > > Well, now with MFC90 folders of WinSxS moved away, and Pythonwin.exe > finally not booting as wanted, I move then back the 5 MFC files from > C:\Python27\Lib\site-packages\pythonwin\_mv to > C:\Python27\Lib\site-packages\pythonwin . But Pythowin.exe now doesn't > start with that files right next to it (where precisely the same version > is in Pythonwin.exe manifest and in that Microsoft.VC90.MFC.manifest > file), nor does import win32ui in python(w).exe work. > (ImportError: DLL load failed: The referenced assembly is not installed > on the computer) > Pythonwin.exe or win32ui won't load until > C:\WINDOWS\WinSxS\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_028bc > > 148 is in Place. Is it possible that Windows is keeping an index of what is installed, so it *thinks* it will find the assembly in the SxS directory but fails to locate it and doesn't try the directory next to the modules? > I absolutely don't understand this. How can Pythonwin.exe draw a MFC90 > DLL set with future date and future version, and reject the DLL set > coming with pywin32 installer right next to with right version ... ? > What has to be done to distribute the right binary files for a win32ui app? > > Where do the "active" rather new files in > C:\WINDOWS\WinSxS\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_028bc > > 148 come from at all? Probably from something else you installed - pywin32 doesn't install it. Please continue to share whatever you learn :) Mark > > > Robert > > > PS: By experience the method with placing MSVCRT 90 files + manifest > next to a Python2.6 wxPython app (no MFC/win32ui) worked on fresh > computers (which I don't have easily at hand). > > But here c:\python27\python.exe requires > C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_31a54e43 > > .. while 'name="Microsoft.VC90.CRT" version="9.0.21022.8"' is in its > built-in manifest > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 From kxroberto at googlemail.com Tue Nov 8 10:41:57 2011 From: kxroberto at googlemail.com (Robert) Date: Tue, 08 Nov 2011 10:41:57 +0100 Subject: [python-win32] WinSxS, manifests and binary distribution ? In-Reply-To: <4EB8B7FA.7070207@gmail.com> References: <4EB8B7FA.7070207@gmail.com> Message-ID: Mark Hammond wrote: > I'm afraid some of the assembly stuff is truly black-magic to me, > but I'll answer what I can. > > > On 8/11/2011 1:28 AM, Robert wrote: > ... >> >> Now when I move away the 5 MFC files (4 dlls + manifest) to _mv, >> then >> Pythonwin.exe still runs properly! >> And it does so until I move the folder >> C:\WINDOWS\WinSxS\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_028bc148 >> >> away to C:\WINDOWS\WinSxS\_mv >> >> (There are 2 more 9.0 MFC folders in WinSxS, but they have no >> effect >> regarding Pythonwin.exe - on or off) >> >> Well, but Pythonwin.exe has a builtin manifest >> (win32api.LoadResource(None, 24, 1)) which draws >> version="9.0.21022.8" - >> and not 9.0.30729.* !? how come? : > > How come what? The C compiler generates this dependency based on > what I have installed, which is VS2008 with no service packs. > >> >> >> > manifestVersion="1.0"> >> >> >> >> > uiAccess="false"> >> >> >> >> >> >> > version="9.0.21022.8" processorArchitecture="x86" >> publicKeyToken="1fc8b3b9a1e18e3b"> >> >> >> >> >> > version="9.0.21022.8" processorArchitecture="x86" >> publicKeyToken="1fc8b3b9a1e18e3b"> >> >> >> >> >> >> Moreover, the files in .. >> >> Verzeichnis von >> C:\WINDOWS\WinSxS\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_028bc >> >> >> 148 >> >> 10.10.2011 11:04 . >> 10.10.2011 11:04 .. >> 18.04.2011 21:51 3.766.600 mfc90.dll >> 18.04.2011 21:51 3.781.960 mfc90u.dll >> 18.04.2011 21:51 59.904 mfcm90.dll >> 18.04.2011 21:51 59.904 mfcm90u.dll >> 4 Datei(en) 7.668.368 Bytes >> 2 Verzeichnis(se), 43.545.792.512 Bytes frei >> >> .. are younger than Pythonwin.exe itself !?? > > I guess the manifest for that version indicates it supports the > older version? > yes it seems this file catches with "bindingRedirect" the version request range 9.0.20718.0-9.0.21022.8 to the newest installed MFC90 DLLs: C:\WINDOWS\WinSxS\Policies\x86_policy.9.0.Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_x-ww_4ee8bb30 >> >> Well, now with MFC90 folders of WinSxS moved away, and >> Pythonwin.exe >> finally not booting as wanted, I move then back the 5 MFC files >> from >> C:\Python27\Lib\site-packages\pythonwin\_mv to >> C:\Python27\Lib\site-packages\pythonwin . But Pythowin.exe now >> doesn't >> start with that files right next to it (where precisely the same >> version >> is in Pythonwin.exe manifest and in that >> Microsoft.VC90.MFC.manifest >> file), nor does import win32ui in python(w).exe work. >> (ImportError: DLL load failed: The referenced assembly is not >> installed >> on the computer) >> Pythonwin.exe or win32ui won't load until >> C:\WINDOWS\WinSxS\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_028bc >> >> >> 148 is in Place. > > Is it possible that Windows is keeping an index of what is > installed, so it *thinks* it will find the assembly in the SxS > directory but fails to locate it and doesn't try the directory > next to the modules? > >> I absolutely don't understand this. How can Pythonwin.exe draw a >> MFC90 >> DLL set with future date and future version, and reject the DLL set >> coming with pywin32 installer right next to with right version >> ... ? >> What has to be done to distribute the right binary files for a >> win32ui app? >> >> Where do the "active" rather new files in >> C:\WINDOWS\WinSxS\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_028bc >> >> >> 148 come from at all? > > Probably from something else you installed - pywin32 doesn't > install it. > > Please continue to share whatever you learn :) > > Mark >> >> >> Robert >> >> >> PS: By experience the method with placing MSVCRT 90 files + >> manifest >> next to a Python2.6 wxPython app (no MFC/win32ui) worked on fresh >> computers (which I don't have easily at hand). >> finally I inspected with "depends.exe" (which confirmed well the actual happening as far as I see) and tested the simple "shared assembly" distribution method with VCR DLL(s) and MFC DLL(s) too next to the py2exe'd app files on a fresh XP Virtual Machine. Theory can't fully replace try+error ;-) From the list msvcr90.dll Microsoft.VC90.CRT.manifest (not required: msvcp90.dll (c++ libs), msvcm90.dll (managed code)) mfc90.dll Microsoft.VC90.MFC.manifest .exe.manifest .exe.manifest with the same manifest as embedded in Pythonwin.exe (including the MFC request) is needed as max surprise. When missing, "import dde" fails with pywin 216 with that error mention in the thread nearby. Unlike in build 216, pywin 212's dde.pyd here seems to have the same embedded manifest as win32ui.pyd. The problem is not with win32uiole.pyd. So I guess from 214 -> 215 a sort of bug entered into the pywin build files regarding the dde.pyd lacking a embedded manifest. (I added that on SF bug ID 3314345) Robert From mc at mclaveau.com Tue Nov 8 14:12:04 2011 From: mc at mclaveau.com (Michel Claveau) Date: Tue, 8 Nov 2011 14:12:04 +0100 Subject: [python-win32] WinSxS, manifests and binary distribution ? In-Reply-To: References: <4EB8B7FA.7070207@gmail.com> Message-ID: <6B190F3FFE274630AA86ADB999B91ADA@M14> Hi! *sorry for my bad english* I do not know if my problem has same origine that your, but I have a problem with win32ui, only since pywin32/215 when I call a COM server who contain "import win32ui" With versions 215 ot 216, I have this traceback: Traceback (most recent call last): ... File "D:\Dev\python\pywig.py", line 29, in import win32ui ImportError: DLL load failed: Le module sp?cifi? est introuvable. With version 214 or prior, I have no problem. I (re)-install 216: problem. I (re)-install 214: no problem. I had try to re-register the server ; I had try on a dozen of computers, with differents windows (XP, Vista, 7 ; 32 & 64). With Python 2.6 or 2.7. Always the problem. (all my tests with Pywin32 in 32 bits). I can reproduce the problem at will (on my computers). @-salutations -- Michel Claveau From kxroberto at googlemail.com Wed Nov 9 22:00:23 2011 From: kxroberto at googlemail.com (Robert) Date: Wed, 09 Nov 2011 22:00:23 +0100 Subject: [python-win32] WinSxS, manifests and binary distribution ? In-Reply-To: <6B190F3FFE274630AA86ADB999B91ADA@M14> References: <4EB8B7FA.7070207@gmail.com> <6B190F3FFE274630AA86ADB999B91ADA@M14> Message-ID: Michel Claveau wrote: > Hi! > > *sorry for my bad english* > > I do not know if my problem has same origine that your, but I have > a problem with win32ui, only since pywin32/215 > when I call a COM server who contain "import win32ui" > > With versions 215 ot 216, I have this traceback: > > Traceback (most recent call last): > ... > File "D:\Dev\python\pywig.py", line 29, in > import win32ui > ImportError: DLL load failed: Le module sp?cifi? est introuvable. > > With version 214 or prior, I have no problem. > I (re)-install 216: problem. > I (re)-install 214: no problem. > > I had try to re-register the server ; I had try on a dozen of > computers, with differents windows (XP, Vista, 7 ; 32 & 64). With > Python 2.6 or 2.7. Always the problem. (all my tests with Pywin32 > in 32 bits). > I can reproduce the problem at will (on my computers). > > @-salutations I get a different error in COM servers when loading win32ui: "error in DLL initialization", and even before: a error regarding C-Runtime problems. I just see: In 216 there is a different/no reference to the SxS MSVCR90.dll. While in 212 there was a reference to same WinSxS version as in pythonw.exe. This may be a bug, but all that is a little obscure .. If its really just "DLL load failed: Le module sp?cifi? est introuvable." you may add def syspath(self, arg=0): return unicode(sys.path) to your _public_methods_ (and move the import win32ui from global to a function if not already done) and see.. Check also what is actually called in HKEY_CLASSES_ROOT\CLSID\\LocalServer32 Robert From sangeethak at amiindia.co.in Thu Nov 10 11:40:22 2011 From: sangeethak at amiindia.co.in (sangeetha) Date: Thu, 10 Nov 2011 10:40:22 +0000 (UTC) Subject: [python-win32] Setting object values that are an object (win32com) References: <17863.56235.359000.334249@gargle.gargle.HOWL> Message-ID: Paul Koning equallogic.com> writes: I'm using win32com.client to access WMI (via SWbemServices). Much of it works -- very nice. There are two things I'm trying to do that I can't get to work right. Or rather, two approaches to the same thing, neither of which work. I tried to dig through Microsoft docs to figure this out, but that didn't help. I'm dealing with a class (MSiSCSIInitiator_TargetClass). I have an instance of that class (output of an InstancesOf call in SWbemServices). According to the class definition -- and a browser I have agrees -- that class has a LoginOptions property, of type MSiSCSIInitiator_TargetLoginOptions. In theory, I can set that property and then call the Login method of the Target class, or I can pass a LoginOptions argument into the Target.Login method instead. I tried both. 1. I assume that what I have to do is create an instance of the TargetLoginOptions class, fill that in, then set the LoginOptions attribute of the Target class to what I just created: C = wmi.Get ("MSiSCSIInitiator_TargetLoginOptions") opts = C.SpawnInstance_ () opts.Username = taskfile.user_name opts.Password = taskfile.password opts.AuthType = 1 # CHAP tp.LoginOptions = opts tp.Login () I get a "generic error". From the behavior of the rest of the system, it looks like the operation is attempted, but the outcome is as if the LoginOptions had not been present. 2. Since the Login method has a set of inputs, one of which is LoginOptions, I tried passing "opts" that way. The intuitively obvious syntax is: tp.Login (LoginOptions = opts) but that doesn't work. It looks like method invocation knows about positional arguments but not keyword arguments. So I read an MSDN article that talks about constructing input arguments. It translates to this: ip = wmi.Get ("MSiSCSIInitiator_TargetClass"). \ Methods_ ("Login").inParameters.SpawnInstance_() ip.LoginOptions = opts tp.Login (ip) Same result: no luck (operation is attempted but it acts as if LoginOptions was not present. I also tried changing the last line to: tp.ExecMethod_ ("Login", ip) Almost the same result -- a "Generic Failure" exception, but this time it appears that the operation was not actually attempted. Does anyone have any idea where I can go from here? paul Dear paul, Am also facing the same problem , hope u would have find the solution for this by now .please help me in giving the inputs for the MSiSCSIInitiator_TargetLoginOptions which has to be passed as the input for the MSiSCSIInitiator_Target Class . i couldn't set the chap username and password for logging in the target .please help me - Thanks Sangeetha From pacopyc at gmail.com Fri Nov 11 13:33:07 2011 From: pacopyc at gmail.com (pacopyc pacopyc) Date: Fri, 11 Nov 2011 13:33:07 +0100 Subject: [python-win32] logon remote machine Message-ID: Hi, I must get OS and logged user on remote machine. I use this functions: 1) THIS FUNCTION IS OK (ALWAYS!!!!!!!) def getOperatingSystem(self,host): try: c = wmi.WMI(host, user="domain\user", password="password") os = c.win32_OperatingSystem()[0] except: .............. 2) THIS FUNCTION IS OK, BUT ONLY IF I EXECUTE SCRIPT (FUNCTION) AS HOST'S DOMAIN ADMINISTRATOR def getLoggedUser (self,host): logged_user = [] res = 1 while res: try: user_list, total, res2 = win32net.NetWkstaUserEnum(str(host), 0, res, win32netcon.MAX_PREFERRED_LENGTH) res = res2 logged_user.append(user_list[1]['username']) except: .............. I'D LIKE EXECUTE getLoggedUser FUNCTION AS getOperatingSystem FUNCTION, I'D LIKE EXECUTE getLoggedUser FUNCTION NOT AS HOST'S DOMAIN ADMINISTRATOR BUT AS ANY USER. Can you help me? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From pacopyc at gmail.com Mon Nov 14 19:00:01 2011 From: pacopyc at gmail.com (pacopyc pacopyc) Date: Mon, 14 Nov 2011 19:00:01 +0100 Subject: [python-win32] logon remote machine Message-ID: Ok, I understood. Code is this: handle = win32security.LogonUser('username', 'domain', 'password', win32security.LOGON32_LOGON_NEW_CREDENTIALS, win32security.LOGON32_LOGON_PROVIDER_DEFAULT) win32security.ImpersonateLoggedOnUser(handle) ....... I can connect to remote host with domain administrator user or with a valid local user (also administrator) of remote host (in which case domain is host's netbios_name). Code runs correctly. Bye pacopyc 2011/11/12 > Send python-win32 mailing list submissions to > python-win32 at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/python-win32 > or, via email, send a message with subject or body 'help' to > python-win32-request at python.org > > You can reach the person managing the list at > python-win32-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of python-win32 digest..." > > > Today's Topics: > > 1. logon remote machine (pacopyc pacopyc) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 11 Nov 2011 13:33:07 +0100 > From: pacopyc pacopyc > To: python-win32 at python.org > Subject: [python-win32] logon remote machine > Message-ID: > > > Content-Type: text/plain; charset="iso-8859-1" > > Hi, I must get OS and logged user on remote machine. I use this functions: > > 1) THIS FUNCTION IS OK (ALWAYS!!!!!!!) > def getOperatingSystem(self,host): > try: > c = wmi.WMI(host, user="domain\user", password="password") > os = c.win32_OperatingSystem()[0] > except: > .............. > > 2) THIS FUNCTION IS OK, BUT ONLY IF I EXECUTE SCRIPT (FUNCTION) AS HOST'S > DOMAIN ADMINISTRATOR > def getLoggedUser (self,host): > logged_user = [] > res = 1 > while res: > try: > user_list, total, res2 = > win32net.NetWkstaUserEnum(str(host), 0, res, > win32netcon.MAX_PREFERRED_LENGTH) > res = res2 > logged_user.append(user_list[1]['username']) > except: > .............. > > I'D LIKE EXECUTE getLoggedUser FUNCTION AS getOperatingSystem FUNCTION, I'D > LIKE EXECUTE getLoggedUser FUNCTION NOT AS HOST'S DOMAIN ADMINISTRATOR BUT > AS ANY USER. > > Can you help me? > Thanks > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mail.python.org/pipermail/python-win32/attachments/20111111/0d478bab/attachment-0001.html > > > > ------------------------------ > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > > > End of python-win32 Digest, Vol 104, Issue 8 > ******************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at timgolden.me.uk Tue Nov 15 16:37:40 2011 From: mail at timgolden.me.uk (Tim Golden) Date: Tue, 15 Nov 2011 15:37:40 +0000 Subject: [python-win32] [Tutor] Handling a Unicode Return using Pyodbc In-Reply-To: References: <4EC22E08.3060808@timgolden.me.uk> Message-ID: <4EC28744.70602@timgolden.me.uk> [cc-ing back to the list in case other readers find it helpful...] On 15/11/2011 15:16, Tony Pelletier wrote: > Thanks, Tim! > > This is working brilliantly.... Slow, but working..:) I can go from > here and see if there's a way to speed it up. Well you've got a few options, although an amount depends on how much control you have over your data and how well you can predict. One option is to encode at SQL Server level: CAST your NVARCHAR to VARCHAR as part of the your query, eg: SELECT contacts.id, name = CAST ( contacts.name COLLATE SQL_Latin1_General_CP1_CS_AS AS VARCHAR (200) ) FROM contacts This will bring the text in as bytes encoded Latin1 which you can then write directly to the csv without the encoder. Without having tested this, I imagine it would be faster than encoding blindly at the Python end since it'll happen lower down the stack and you're pinpointing the data rather than running through all the columns on the offchance of finding one which is unicode. An alternative is to arrange something equivalent at the Python end -- ie have specific encoders for different rows which can target the specific columns which are known to be NVARCHAR. TJG From mail at timgolden.me.uk Tue Nov 15 16:42:53 2011 From: mail at timgolden.me.uk (Tim Golden) Date: Tue, 15 Nov 2011 15:42:53 +0000 Subject: [python-win32] [Tutor] Handling a Unicode Return using Pyodbc In-Reply-To: <4EC28744.70602@timgolden.me.uk> References: <4EC22E08.3060808@timgolden.me.uk> <4EC28744.70602@timgolden.me.uk> Message-ID: <4EC2887D.2000904@timgolden.me.uk> On 15/11/2011 15:37, Tim Golden wrote: > [cc-ing back to the list in case other readers find it > helpful...] ... which they won't because I should have cc-ed the python tutor list. Sorry, python-win32! TJG From MPirritano at ochca.com Tue Nov 15 19:25:10 2011 From: MPirritano at ochca.com (Pirritano, Matthew) Date: Tue, 15 Nov 2011 10:25:10 -0800 Subject: [python-win32] FW: run excel macro from python Message-ID: Windows Python People, It was suggested that I might find more help with this question here than on the tutor list. I am running an excel macro from python with the following code: The problem I'm having is that when I try to run this function I get a dialog window that pops up titled: "Update Values: Personal.xls" When I try to cancel out of it I get directed to a type mismatch in the excel macro. The program is very long so I won't paste the whole thing here, just the call to the excel macro. What seems key is that the macro runs fine in excel. And I've run excel macros from python before. The only difference is that now the macro also calls some excel user defined functions. Since they live in Personal.xls I'm thinking that is the wrinkle here. All of my searching has led me nowhere. Has no one ever had this issue? You'll note the excessive closing language in the function. I thought that maybe what was happening is that more than one instance of excel was open and that was causing a problem with accessing personal.xls, as will happen if you try to manually open more than one instance of excel in windows. def runExcelMacro(): excel = win32.Dispatch("Excel.Application") excel.Visible = 0 fTest = excel.Workbooks.Add("D:\\Data\\Excel\\Blank_Summary_Report_Template_Macr o_20111114.xls") macName = "macroAllFiles" macName = fTest.Name + '!' + macName print macName excel.Run(macName) excel.DisplayAlerts = 0 fTest.Close(1) excel.Quit() del excel Any ideas!? Let me know if you need more info. Thanks Matt Matthew Pirritano, Ph.D. Research Analyst IV Medical Services Initiative (MSI) Orange County Health Care Agency (714) 568-5648 -------------- next part -------------- An HTML attachment was scrubbed... URL: From nawijn at gmail.com Wed Nov 16 15:45:32 2011 From: nawijn at gmail.com (Marco Nawijn) Date: Wed, 16 Nov 2011 15:45:32 +0100 Subject: [python-win32] Problem connecting to OPC server through COM interface Message-ID: Dear All, I am running into a strange problem (for me). I use the openopc (www.openopc.org) python package to connect to a OPC server through COM. I have the following code: import openopc opc = openopc.client('OPC.Automation.1') If I run this code from within PythonWin, it succeeds. However, when I run the code from within a normal python shell, it fails with the following error: OPCError: Dispatch: Invalid access to memory location My main questions are, what is the difference between the embedded PythonWin shell and a normal python shell, and do you have any suggestion on how to solve/debug the issue? Kind regards, Marco From toddfiske at gmail.com Thu Nov 17 18:43:46 2011 From: toddfiske at gmail.com (Todd Fiske) Date: Thu, 17 Nov 2011 12:43:46 -0500 Subject: [python-win32] FW: run excel macro from python In-Reply-To: References: Message-ID: Hi Matthew, Have you tried moving the DisplayAlerts line before the Run statement? I don't know that it will help but it may. Todd From kxroberto at googlemail.com Fri Nov 18 17:23:55 2011 From: kxroberto at googlemail.com (Robert) Date: Fri, 18 Nov 2011 17:23:55 +0100 Subject: [python-win32] manifest "Microsoft.Windows.Common-Controls" version="6.0.0.0" => strange problem with pywin32 build 216 ? Message-ID: In C:\Python23 and C:\Python26 installations there are python(s).exe.manifest files which contain '"Microsoft.Windows.Common-Controls" version="6.0.0.0"' (see attached/below) With pywin32 build 216 (was not in 212; and 214 I guess) win32ui apps, which are started by these python(w).exe's , a strange auto-magical button pressing is going on, immediately after application start. almost any button is pressed when the mouse moves.. By chance its possible to stop the show in the Task Manager. It seems (seen by a debug output), that notification messages (BN_.. (Which could be routed via HookNotify?)) or so do trigger the normal HookCommand'ed handler. When that Common-Controls section (or the whole .manifest) is removed, the apps work normal in build 216. What could be the reason? What does this Common-Control section actually do? Robert -- Python Interpreter -------------- next part -------------- A non-text attachment was scrubbed... Name: python.exe.manifest Type: text/xml Size: 920 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: python.exe.manifest Type: text/xml Size: 631 bytes Desc: not available URL: From karra.etc at gmail.com Mon Nov 21 08:03:43 2011 From: karra.etc at gmail.com (Sriram ET.) Date: Mon, 21 Nov 2011 12:33:43 +0530 Subject: [python-win32] Setting a 64bit FILETIME PT_SYSTIME property using pywin32's SetProps() Message-ID: I am using pywin32 mapi routines to interact with my outlook contacts store. I am trying to set the PT_BIRTHDAY property and have the following code for doing that: The conversion from and to FILETIME values is from filetimes.py available at:http://reliablybroken.com/b/wp-content/filetimes.py dt = datetime.strptime('1980-01-01','%Y-%m-%d') filetime = filetimes.dt_to_filetime(dt) msg.SetProps([(mapitags.PR_BIRTHDAY, filetime)]) I get an OverflowError: Python int too large to convert to c long I am on a 32 bit machine, and I understand FILETME is a 64 bit value. I am at a loss. How can I set the underlying MAPI property using this library? Is there a workaround? (Setup: Outlook 2010, Window 7 running on a 32bit virtual machine via VMWare Fusion 4 on Mac OS X Lion) Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhihong.chen.cn at gmail.com Tue Nov 22 04:06:56 2011 From: zhihong.chen.cn at gmail.com (=?UTF-8?B?6ZmI5pm65a6P?=) Date: Tue, 22 Nov 2011 11:06:56 +0800 Subject: [python-win32] python-win32 Digest, Vol 104, Issue 14 In-Reply-To: References: Message-ID: http://sourceforge.net/tracker/?func=detail&aid=3438213&group_id=78018&atid=551954 It seems that it's the same issue. Python3 broken filetime processing for python win32. On Mon, Nov 21, 2011 at 7:00 PM, wrote: > Send python-win32 mailing list submissions to > python-win32 at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/python-win32 > or, via email, send a message with subject or body 'help' to > python-win32-request at python.org > > You can reach the person managing the list at > python-win32-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of python-win32 digest..." > > > Today's Topics: > > 1. Setting a 64bit FILETIME PT_SYSTIME property using pywin32's > SetProps() (Sriram ET.) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 21 Nov 2011 12:33:43 +0530 > From: "Sriram ET." > To: python-win32 at mail.python.org > Subject: [python-win32] Setting a 64bit FILETIME PT_SYSTIME property > using pywin32's SetProps() > Message-ID: > > > Content-Type: text/plain; charset="iso-8859-1" > > I am using pywin32 mapi routines to interact with my outlook contacts > store. I am trying to set the PT_BIRTHDAY property and have the following > code for doing that: > > The conversion from and to FILETIME values is from filetimes.py available > at:http://reliablybroken.com/b/wp-content/filetimes.py > > dt = datetime.strptime('1980-01-01','%Y-%m-%d') > filetime = filetimes.dt_to_filetime(dt) > msg.SetProps([(mapitags.PR_BIRTHDAY, filetime)]) > > I get an OverflowError: Python int too large to convert to c long > > I am on a 32 bit machine, and I understand FILETME is a 64 bit value. I am > at a loss. How can I set the underlying MAPI property using this library? > Is there a workaround? > > (Setup: Outlook 2010, Window 7 running on a 32bit virtual machine via > VMWare Fusion 4 on Mac OS X Lion) > > Thanks! > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mail.python.org/pipermail/python-win32/attachments/20111121/3400bbab/attachment-0001.html > > > > ------------------------------ > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > > > End of python-win32 Digest, Vol 104, Issue 14 > ********************************************* > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhihong.chen.cn at gmail.com Tue Nov 22 04:10:03 2011 From: zhihong.chen.cn at gmail.com (=?UTF-8?B?6ZmI5pm65a6P?=) Date: Tue, 22 Nov 2011 11:10:03 +0800 Subject: [python-win32] python-win32 Digest, Vol 104, Issue 14 In-Reply-To: References: Message-ID: http://sourceforge.net/tracker/?func=detail&aid=2831327&group_id=78018&atid=551954 UTC / Local time break pythonwin for Python32. A lot of function does not work. Simple throws following messages: ValueError: astimezone() cannot be applied to a naive datetime On Mon, Nov 21, 2011 at 7:00 PM, wrote: > Send python-win32 mailing list submissions to > python-win32 at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/python-win32 > or, via email, send a message with subject or body 'help' to > python-win32-request at python.org > > You can reach the person managing the list at > python-win32-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of python-win32 digest..." > > > Today's Topics: > > 1. Setting a 64bit FILETIME PT_SYSTIME property using pywin32's > SetProps() (Sriram ET.) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 21 Nov 2011 12:33:43 +0530 > From: "Sriram ET." > To: python-win32 at mail.python.org > Subject: [python-win32] Setting a 64bit FILETIME PT_SYSTIME property > using pywin32's SetProps() > Message-ID: > > > Content-Type: text/plain; charset="iso-8859-1" > > I am using pywin32 mapi routines to interact with my outlook contacts > store. I am trying to set the PT_BIRTHDAY property and have the following > code for doing that: > > The conversion from and to FILETIME values is from filetimes.py available > at:http://reliablybroken.com/b/wp-content/filetimes.py > > dt = datetime.strptime('1980-01-01','%Y-%m-%d') > filetime = filetimes.dt_to_filetime(dt) > msg.SetProps([(mapitags.PR_BIRTHDAY, filetime)]) > > I get an OverflowError: Python int too large to convert to c long > > I am on a 32 bit machine, and I understand FILETME is a 64 bit value. I am > at a loss. How can I set the underlying MAPI property using this library? > Is there a workaround? > > (Setup: Outlook 2010, Window 7 running on a 32bit virtual machine via > VMWare Fusion 4 on Mac OS X Lion) > > Thanks! > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mail.python.org/pipermail/python-win32/attachments/20111121/3400bbab/attachment-0001.html > > > > ------------------------------ > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > > > End of python-win32 Digest, Vol 104, Issue 14 > ********************************************* > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhihong.chen.cn at gmail.com Tue Nov 22 04:05:16 2011 From: zhihong.chen.cn at gmail.com (=?UTF-8?B?6ZmI5pm65a6P?=) Date: Tue, 22 Nov 2011 11:05:16 +0800 Subject: [python-win32] The python3 compatibility issues Message-ID: Dear ALL, For the python3.2.2, there is different Timezone processing strategy which will cause Com api call failed in the sample. I have submitted the tickets on the below. http://sourceforge.net/tracker/?func=detail&aid=3438213&group_id=78018&atid=551954 -------------- next part -------------- An HTML attachment was scrubbed... URL: From karra.etc at gmail.com Tue Nov 22 11:27:15 2011 From: karra.etc at gmail.com (Sriram ET.) Date: Tue, 22 Nov 2011 15:57:15 +0530 Subject: [python-win32] Setting a 64bit FILETIME PT_SYSTIME property using pywin32's SetProps() Message-ID: Zhihong, I am not familiar with the internals enough to confirm if the issue you are pointing out and the problem in my original email are the same. I am using Python 2.7 on windows 32 bit. Can you explain why you feel the two issues are the same? -Sriram On Tue, Nov 22, 2011 at 8:36 AM, ??? wrote: > > http://sourceforge.net/tracker/?func=detail&aid=3438213&group_id=78018&atid=551954 > > It seems that it's the same issue. > > Python3 broken filetime processing for python win32. > > On Mon, Nov 21, 2011 at 7:00 PM, wrote: > >> Send python-win32 mailing list submissions to >> python-win32 at python.org >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://mail.python.org/mailman/listinfo/python-win32 >> or, via email, send a message with subject or body 'help' to >> python-win32-request at python.org >> >> You can reach the person managing the list at >> python-win32-owner at python.org >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of python-win32 digest..." >> >> >> Today's Topics: >> >> 1. Setting a 64bit FILETIME PT_SYSTIME property using pywin32's >> SetProps() (Sriram ET.) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Mon, 21 Nov 2011 12:33:43 +0530 >> From: "Sriram ET." >> To: python-win32 at mail.python.org >> Subject: [python-win32] Setting a 64bit FILETIME PT_SYSTIME property >> using pywin32's SetProps() >> Message-ID: >> > wWQ at mail.gmail.com> >> Content-Type: text/plain; charset="iso-8859-1" >> >> I am using pywin32 mapi routines to interact with my outlook contacts >> store. I am trying to set the PT_BIRTHDAY property and have the following >> code for doing that: >> >> The conversion from and to FILETIME values is from filetimes.py available >> at:http://reliablybroken.com/b/wp-content/filetimes.py >> >> dt = datetime.strptime('1980-01-01','%Y-%m-%d') >> filetime = filetimes.dt_to_filetime(dt) >> msg.SetProps([(mapitags.PR_BIRTHDAY, filetime)]) >> >> I get an OverflowError: Python int too large to convert to c long >> >> I am on a 32 bit machine, and I understand FILETME is a 64 bit value. I am >> at a loss. How can I set the underlying MAPI property using this library? >> Is there a workaround? >> >> (Setup: Outlook 2010, Window 7 running on a 32bit virtual machine via >> VMWare Fusion 4 on Mac OS X Lion) >> >> Thanks! >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: < >> http://mail.python.org/pipermail/python-win32/attachments/20111121/3400bbab/attachment-0001.html >> > >> >> ------------------------------ >> >> _______________________________________________ >> python-win32 mailing list >> python-win32 at python.org >> http://mail.python.org/mailman/listinfo/python-win32 >> >> >> End of python-win32 Digest, Vol 104, Issue 14 >> ********************************************* >> > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhihong.chen.cn at gmail.com Tue Nov 22 11:56:00 2011 From: zhihong.chen.cn at gmail.com (=?UTF-8?B?6ZmI5pm65a6P?=) Date: Tue, 22 Nov 2011 18:56:00 +0800 Subject: [python-win32] Setting a 64bit FILETIME PT_SYSTIME property using pywin32's SetProps() In-Reply-To: References: Message-ID: Dear Sriram, Pythonwin has internal standard one to process win32time. I have found the solution on http://sourceforge.net/tracker/?func=detail&aid=3438213&group_id=78018&atid=551954 In fact, there is crapy code in Pytime.cpp which supports OLD version of Python timezone processing. But for new version of Python, standard one is perfect. There is backports for 2.7 from 3.x. For me , I use 3.2.2 and test the solution. It's OK. Just make sure that in *win32/src/PyWinTypes.h * * * *NO_PYWINTYPES_TIME,**PYWIN_HAVE_DATETIME_CAPI BOTH are not defined.* * * *you need to changed my code **#if (PY_VERSION_HEX < 0x03000000) to **#if (PY_VERSION_HEX < 0x02000000)* * * This issues is caused by old version compatibility. In pythonwin, there is already implemented new one. But there is incorrect define in Headers. * * I guest this solution will be ok for you as well. On Tue, Nov 22, 2011 at 6:27 PM, Sriram ET. wrote: > > Zhihong, I am not familiar with the internals enough to confirm if the > issue you are pointing out and the problem in my original email are the > same. I am using Python 2.7 on windows 32 bit. Can you explain why you feel > the two issues are the same? > > -Sriram > > On Tue, Nov 22, 2011 at 8:36 AM, ??? wrote: > >> >> http://sourceforge.net/tracker/?func=detail&aid=3438213&group_id=78018&atid=551954 >> >> It seems that it's the same issue. >> >> Python3 broken filetime processing for python win32. >> >> On Mon, Nov 21, 2011 at 7:00 PM, wrote: >> >>> Send python-win32 mailing list submissions to >>> python-win32 at python.org >>> >>> To subscribe or unsubscribe via the World Wide Web, visit >>> http://mail.python.org/mailman/listinfo/python-win32 >>> or, via email, send a message with subject or body 'help' to >>> python-win32-request at python.org >>> >>> You can reach the person managing the list at >>> python-win32-owner at python.org >>> >>> When replying, please edit your Subject line so it is more specific >>> than "Re: Contents of python-win32 digest..." >>> >>> >>> Today's Topics: >>> >>> 1. Setting a 64bit FILETIME PT_SYSTIME property using pywin32's >>> SetProps() (Sriram ET.) >>> >>> >>> ---------------------------------------------------------------------- >>> >>> Message: 1 >>> Date: Mon, 21 Nov 2011 12:33:43 +0530 >>> From: "Sriram ET." >>> To: python-win32 at mail.python.org >>> Subject: [python-win32] Setting a 64bit FILETIME PT_SYSTIME property >>> using pywin32's SetProps() >>> Message-ID: >>> >> wWQ at mail.gmail.com> >>> Content-Type: text/plain; charset="iso-8859-1" >>> >>> I am using pywin32 mapi routines to interact with my outlook contacts >>> store. I am trying to set the PT_BIRTHDAY property and have the following >>> code for doing that: >>> >>> The conversion from and to FILETIME values is from filetimes.py available >>> at:http://reliablybroken.com/b/wp-content/filetimes.py >>> >>> dt = datetime.strptime('1980-01-01','%Y-%m-%d') >>> filetime = filetimes.dt_to_filetime(dt) >>> msg.SetProps([(mapitags.PR_BIRTHDAY, filetime)]) >>> >>> I get an OverflowError: Python int too large to convert to c long >>> >>> I am on a 32 bit machine, and I understand FILETME is a 64 bit value. I >>> am >>> at a loss. How can I set the underlying MAPI property using this library? >>> Is there a workaround? >>> >>> (Setup: Outlook 2010, Window 7 running on a 32bit virtual machine via >>> VMWare Fusion 4 on Mac OS X Lion) >>> >>> Thanks! >>> -------------- next part -------------- >>> An HTML attachment was scrubbed... >>> URL: < >>> http://mail.python.org/pipermail/python-win32/attachments/20111121/3400bbab/attachment-0001.html >>> > >>> >>> ------------------------------ >>> >>> _______________________________________________ >>> python-win32 mailing list >>> python-win32 at python.org >>> http://mail.python.org/mailman/listinfo/python-win32 >>> >>> >>> End of python-win32 Digest, Vol 104, Issue 14 >>> ********************************************* >>> >> >> >> _______________________________________________ >> python-win32 mailing list >> python-win32 at python.org >> http://mail.python.org/mailman/listinfo/python-win32 >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karra.etc at gmail.com Tue Nov 22 14:39:35 2011 From: karra.etc at gmail.com (Sriram ET.) Date: Tue, 22 Nov 2011 19:09:35 +0530 Subject: [python-win32] Setting a 64bit FILETIME PT_SYSTIME property using pywin32's SetProps() In-Reply-To: References: Message-ID: Hm, I do not have a Visual Studio or similar development environment set up on my machine. Rebuilding from scratch - is there no other option? Thanks! Sriram On Tue, Nov 22, 2011 at 4:26 PM, ??? wrote: > Dear Sriram, > > Pythonwin has internal standard one to process win32time. > > I have found the solution on > http://sourceforge.net/tracker/?func=detail&aid=3438213&group_id=78018&atid=551954 > > In fact, there is crapy code in Pytime.cpp which supports OLD version of > Python timezone processing. > > But for new version of Python, standard one is perfect. > > There is backports for 2.7 from 3.x. For me , I use 3.2.2 and test the > solution. It's OK. > > Just make sure that in *win32/src/PyWinTypes.h * > * > * > *NO_PYWINTYPES_TIME,**PYWIN_HAVE_DATETIME_CAPI BOTH are not defined.* > * > * > *you need to changed my code **#if (PY_VERSION_HEX < 0x03000000) to **#if > (PY_VERSION_HEX < 0x02000000)* > * > * > This issues is caused by old version compatibility. In pythonwin, there is > already implemented new one. But there is incorrect define in Headers. > * > * > I guest this solution will be ok for you as well. > > On Tue, Nov 22, 2011 at 6:27 PM, Sriram ET. wrote: > >> >> Zhihong, I am not familiar with the internals enough to confirm if the >> issue you are pointing out and the problem in my original email are the >> same. I am using Python 2.7 on windows 32 bit. Can you explain why you feel >> the two issues are the same? >> >> -Sriram >> >> On Tue, Nov 22, 2011 at 8:36 AM, ??? wrote: >> >>> >>> http://sourceforge.net/tracker/?func=detail&aid=3438213&group_id=78018&atid=551954 >>> >>> It seems that it's the same issue. >>> >>> Python3 broken filetime processing for python win32. >>> >>> On Mon, Nov 21, 2011 at 7:00 PM, wrote: >>> >>>> Send python-win32 mailing list submissions to >>>> python-win32 at python.org >>>> >>>> To subscribe or unsubscribe via the World Wide Web, visit >>>> http://mail.python.org/mailman/listinfo/python-win32 >>>> or, via email, send a message with subject or body 'help' to >>>> python-win32-request at python.org >>>> >>>> You can reach the person managing the list at >>>> python-win32-owner at python.org >>>> >>>> When replying, please edit your Subject line so it is more specific >>>> than "Re: Contents of python-win32 digest..." >>>> >>>> >>>> Today's Topics: >>>> >>>> 1. Setting a 64bit FILETIME PT_SYSTIME property using pywin32's >>>> SetProps() (Sriram ET.) >>>> >>>> >>>> ---------------------------------------------------------------------- >>>> >>>> Message: 1 >>>> Date: Mon, 21 Nov 2011 12:33:43 +0530 >>>> From: "Sriram ET." >>>> To: python-win32 at mail.python.org >>>> Subject: [python-win32] Setting a 64bit FILETIME PT_SYSTIME property >>>> using pywin32's SetProps() >>>> Message-ID: >>>> >>> wWQ at mail.gmail.com> >>>> Content-Type: text/plain; charset="iso-8859-1" >>>> >>>> I am using pywin32 mapi routines to interact with my outlook contacts >>>> store. I am trying to set the PT_BIRTHDAY property and have the >>>> following >>>> code for doing that: >>>> >>>> The conversion from and to FILETIME values is from filetimes.py >>>> available >>>> at:http://reliablybroken.com/b/wp-content/filetimes.py >>>> >>>> dt = datetime.strptime('1980-01-01','%Y-%m-%d') >>>> filetime = filetimes.dt_to_filetime(dt) >>>> msg.SetProps([(mapitags.PR_BIRTHDAY, filetime)]) >>>> >>>> I get an OverflowError: Python int too large to convert to c long >>>> >>>> I am on a 32 bit machine, and I understand FILETME is a 64 bit value. I >>>> am >>>> at a loss. How can I set the underlying MAPI property using this >>>> library? >>>> Is there a workaround? >>>> >>>> (Setup: Outlook 2010, Window 7 running on a 32bit virtual machine via >>>> VMWare Fusion 4 on Mac OS X Lion) >>>> >>>> Thanks! >>>> -------------- next part -------------- >>>> An HTML attachment was scrubbed... >>>> URL: < >>>> http://mail.python.org/pipermail/python-win32/attachments/20111121/3400bbab/attachment-0001.html >>>> > >>>> >>>> ------------------------------ >>>> >>>> _______________________________________________ >>>> python-win32 mailing list >>>> python-win32 at python.org >>>> http://mail.python.org/mailman/listinfo/python-win32 >>>> >>>> >>>> End of python-win32 Digest, Vol 104, Issue 14 >>>> ********************************************* >>>> >>> >>> >>> _______________________________________________ >>> python-win32 mailing list >>> python-win32 at python.org >>> http://mail.python.org/mailman/listinfo/python-win32 >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karra.etc at gmail.com Tue Nov 22 15:16:46 2011 From: karra.etc at gmail.com (Sriram ET.) Date: Tue, 22 Nov 2011 19:46:46 +0530 Subject: [python-win32] Setting a 64bit FILETIME PT_SYSTIME property using pywin32's SetProps() In-Reply-To: References: Message-ID: I guess my question is - does it not make sense to push this fix into the main tree and release a build? 2011/11/22 Sriram ET. > > Hm, I do not have a Visual Studio or similar development environment set > up on my machine. Rebuilding from scratch - is there no other option? > > Thanks! > Sriram > > > On Tue, Nov 22, 2011 at 4:26 PM, ??? wrote: > >> Dear Sriram, >> >> Pythonwin has internal standard one to process win32time. >> >> I have found the solution on >> http://sourceforge.net/tracker/?func=detail&aid=3438213&group_id=78018&atid=551954 >> >> In fact, there is crapy code in Pytime.cpp which supports OLD version of >> Python timezone processing. >> >> But for new version of Python, standard one is perfect. >> >> There is backports for 2.7 from 3.x. For me , I use 3.2.2 and test the >> solution. It's OK. >> >> Just make sure that in *win32/src/PyWinTypes.h * >> * >> * >> *NO_PYWINTYPES_TIME,**PYWIN_HAVE_DATETIME_CAPI BOTH are not defined.* >> * >> * >> *you need to changed my code **#if (PY_VERSION_HEX < 0x03000000) to **#if >> (PY_VERSION_HEX < 0x02000000)* >> * >> * >> This issues is caused by old version compatibility. In pythonwin, there >> is already implemented new one. But there is incorrect define in Headers. >> * >> * >> I guest this solution will be ok for you as well. >> >> On Tue, Nov 22, 2011 at 6:27 PM, Sriram ET. wrote: >> >>> >>> Zhihong, I am not familiar with the internals enough to confirm if the >>> issue you are pointing out and the problem in my original email are the >>> same. I am using Python 2.7 on windows 32 bit. Can you explain why you feel >>> the two issues are the same? >>> >>> -Sriram >>> >>> On Tue, Nov 22, 2011 at 8:36 AM, ??? wrote: >>> >>>> >>>> http://sourceforge.net/tracker/?func=detail&aid=3438213&group_id=78018&atid=551954 >>>> >>>> It seems that it's the same issue. >>>> >>>> Python3 broken filetime processing for python win32. >>>> >>>> On Mon, Nov 21, 2011 at 7:00 PM, wrote: >>>> >>>>> Send python-win32 mailing list submissions to >>>>> python-win32 at python.org >>>>> >>>>> To subscribe or unsubscribe via the World Wide Web, visit >>>>> http://mail.python.org/mailman/listinfo/python-win32 >>>>> or, via email, send a message with subject or body 'help' to >>>>> python-win32-request at python.org >>>>> >>>>> You can reach the person managing the list at >>>>> python-win32-owner at python.org >>>>> >>>>> When replying, please edit your Subject line so it is more specific >>>>> than "Re: Contents of python-win32 digest..." >>>>> >>>>> >>>>> Today's Topics: >>>>> >>>>> 1. Setting a 64bit FILETIME PT_SYSTIME property using >>>>> pywin32's >>>>> SetProps() (Sriram ET.) >>>>> >>>>> >>>>> ---------------------------------------------------------------------- >>>>> >>>>> Message: 1 >>>>> Date: Mon, 21 Nov 2011 12:33:43 +0530 >>>>> From: "Sriram ET." >>>>> To: python-win32 at mail.python.org >>>>> Subject: [python-win32] Setting a 64bit FILETIME PT_SYSTIME property >>>>> using pywin32's SetProps() >>>>> Message-ID: >>>>> >>>> wWQ at mail.gmail.com> >>>>> Content-Type: text/plain; charset="iso-8859-1" >>>>> >>>>> I am using pywin32 mapi routines to interact with my outlook contacts >>>>> store. I am trying to set the PT_BIRTHDAY property and have the >>>>> following >>>>> code for doing that: >>>>> >>>>> The conversion from and to FILETIME values is from filetimes.py >>>>> available >>>>> at:http://reliablybroken.com/b/wp-content/filetimes.py >>>>> >>>>> dt = datetime.strptime('1980-01-01','%Y-%m-%d') >>>>> filetime = filetimes.dt_to_filetime(dt) >>>>> msg.SetProps([(mapitags.PR_BIRTHDAY, filetime)]) >>>>> >>>>> I get an OverflowError: Python int too large to convert to c long >>>>> >>>>> I am on a 32 bit machine, and I understand FILETME is a 64 bit value. >>>>> I am >>>>> at a loss. How can I set the underlying MAPI property using this >>>>> library? >>>>> Is there a workaround? >>>>> >>>>> (Setup: Outlook 2010, Window 7 running on a 32bit virtual machine via >>>>> VMWare Fusion 4 on Mac OS X Lion) >>>>> >>>>> Thanks! >>>>> -------------- next part -------------- >>>>> An HTML attachment was scrubbed... >>>>> URL: < >>>>> http://mail.python.org/pipermail/python-win32/attachments/20111121/3400bbab/attachment-0001.html >>>>> > >>>>> >>>>> ------------------------------ >>>>> >>>>> _______________________________________________ >>>>> python-win32 mailing list >>>>> python-win32 at python.org >>>>> http://mail.python.org/mailman/listinfo/python-win32 >>>>> >>>>> >>>>> End of python-win32 Digest, Vol 104, Issue 14 >>>>> ********************************************* >>>>> >>>> >>>> >>>> _______________________________________________ >>>> python-win32 mailing list >>>> python-win32 at python.org >>>> http://mail.python.org/mailman/listinfo/python-win32 >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ckkart at hoc.net Wed Nov 23 22:09:18 2011 From: ckkart at hoc.net (Christian K.) Date: Wed, 23 Nov 2011 22:09:18 +0100 Subject: [python-win32] addin fails to load the first time after login Message-ID: Hi, I am observing a strange behaviour of two python com-servers/addins, one of them is called from Excel VBA the other one is an Outlook (both from Office 2003) addin. Both of them work if I register them and start using Outlook or Excel thereafter. However when I log out and login the next time, both of them fail to load. Excel is showing an error message when CreateObject("addin") is called, showing a python traceback from somewhere within win32com (only parts of it since the window cannot be resized). Outlook silently ignores the addin and in the list of com_addins it is marked as deactivated. Re-registering solves the problem until the next login. Interestingly I get them to work if I start e.g. spyder (a python IDE) before making calls to the com servers. It does not seem to help though, if I only open a python shell. This sounds like a timeout issue to me. Do you know what might be the cause and what I can do about it? Best regards, Christian From jacobk at mailzone.co.za Fri Nov 25 15:33:25 2011 From: jacobk at mailzone.co.za (Jacob Kruger) Date: Fri, 25 Nov 2011 16:33:25 +0200 Subject: [python-win32] MySQL connection/admin tool Message-ID: Busy now building a sort of MySQL admin interface, and installed MySQL-python-1.2.3.win32-py2.7.exe, and see it includes both the basic mysql module, as well as something called MySQLdb which is some sort of a wrapper or something, but anyway. Anyway, was just wondering if there are specific ways it would be better to connect to a MySQL database/server, and if there are commonly used examples out there, since didn't seem to find any off hand, and this is starting to come together, but, just wondering..? Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' -------------- next part -------------- An HTML attachment was scrubbed... URL: From vernondcole at gmail.com Fri Nov 25 18:32:07 2011 From: vernondcole at gmail.com (Vernon Cole) Date: Fri, 25 Nov 2011 10:32:07 -0700 Subject: [python-win32] MySQL connection/admin tool In-Reply-To: References: Message-ID: Jacob: adodbapi provides an extended dbapi 2.0 (PEP 249) connection to many databases, MySQL is one of the ones I test with regularly. It is included in pywin32. Just "import adodbapi" to use it. (You do have to install the MySQL ODBC driver.) The other packages you mention are MySQL specific, and may have more features specific to MySQL, I don't know ... I've never tried them. Examples of PEP 249 use can be found on Google search "python database api example". Examples of adodbapi use are in the "tests" folder under site_packages/adodbapi -- see also http://sourceforge.net/projects/adodbapi/ good luck -- Vernon On Fri, Nov 25, 2011 at 7:33 AM, Jacob Kruger wrote: > ** > Busy now building a sort of MySQL admin interface, and installed > MySQL-python-1.2.3.win32-py2.7.exe, and see it includes both the basic > mysql module, as well as something called MySQLdb which is some sort of a > wrapper or something, but anyway. > > Anyway, was just wondering if there are specific ways it would be better > to connect to a MySQL database/server, and if there are commonly used > examples out there, since didn't seem to find any off hand, and this is > starting to come together, but, just wondering..? > > Stay well > > Jacob Kruger > Blind Biker > Skype: BlindZA > '...fate had broken his body, but not his spirit...' > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jacobk at mailzone.co.za Fri Nov 25 21:18:30 2011 From: jacobk at mailzone.co.za (Jacob Kruger) Date: Fri, 25 Nov 2011 22:18:30 +0200 Subject: [python-win32] MySQL connection/admin tool In-Reply-To: References: Message-ID: Will check it out. Thanks Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ----- Original Message ----- From: Vernon Cole To: Jacob Kruger Cc: python-win32 at python.org Sent: Friday, November 25, 2011 7:32 PM Subject: Re: [python-win32] MySQL connection/admin tool Jacob: adodbapi provides an extended dbapi 2.0 (PEP 249) connection to many databases, MySQL is one of the ones I test with regularly. It is included in pywin32. Just "import adodbapi" to use it. (You do have to install the MySQL ODBC driver.) The other packages you mention are MySQL specific, and may have more features specific to MySQL, I don't know ... I've never tried them. Examples of PEP 249 use can be found on Google search "python database api example". Examples of adodbapi use are in the "tests" folder under site_packages/adodbapi -- see also http://sourceforge.net/projects/adodbapi/ good luck -- Vernon On Fri, Nov 25, 2011 at 7:33 AM, Jacob Kruger wrote: Busy now building a sort of MySQL admin interface, and installed MySQL-python-1.2.3.win32-py2.7.exe, and see it includes both the basic mysql module, as well as something called MySQLdb which is some sort of a wrapper or something, but anyway. Anyway, was just wondering if there are specific ways it would be better to connect to a MySQL database/server, and if there are commonly used examples out there, since didn't seem to find any off hand, and this is starting to come together, but, just wondering..? Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' _______________________________________________ python-win32 mailing list python-win32 at python.org http://mail.python.org/mailman/listinfo/python-win32 -------------- next part -------------- An HTML attachment was scrubbed... URL: From qgold.77 at gmail.com Sat Nov 26 01:19:47 2011 From: qgold.77 at gmail.com (Nick) Date: Fri, 25 Nov 2011 16:19:47 -0800 Subject: [python-win32] MySQL connection/admin tool In-Reply-To: Message-ID: <1D9EF1545D4945D1BFF891AE40D46046@nick> As new Python user, my discovery of the ADODBAPI package is very encouraging - is there any documentation other than that in the test cases? Regards - Nick -----Original Message----- From: python-win32-bounces+qgold.77=gmail.com at python.org [mailto:python-win32-bounces+qgold.77=gmail.com at python.org] On Behalf Of Vernon Cole Sent: November 25, 2011 9:32 AM To: Jacob Kruger Cc: python-win32 at python.org Subject: Re: [python-win32] MySQL connection/admin tool Jacob: adodbapi provides an extended dbapi 2.0 (PEP 249) connection to many databases, MySQL is one of the ones I test with regularly. It is included in pywin32. Just "import adodbapi" to use it. (You do have to install the MySQL ODBC driver.) The other packages you mention are MySQL specific, and may have more features specific to MySQL, I don't know ... I've never tried them. Examples of PEP 249 use can be found on Google search "python database api example". Examples of adodbapi use are in the "tests" folder under site_packages/adodbapi -- see also http://sourceforge.net/projects/adodbapi/ good luck -- Vernon -------------- next part -------------- An HTML attachment was scrubbed... URL: From rohit.kumar at chelsio.com Sat Nov 26 11:20:14 2011 From: rohit.kumar at chelsio.com (Rohit Kumar) Date: Sat, 26 Nov 2011 10:20:14 +0000 (UTC) Subject: [python-win32] =?utf-8?q?Calling_Win32=5FNetworkAdapterConfigurat?= =?utf-8?q?ion_routines_from_WMI_com_object?= Message-ID: Thanks in advance for help. I am trying to set the ip address of a network interface using win32com module and unable to do so. I have tried searching a lot but wasn't able to get a answer for the issue. Here is the code I am running : import win32com.client obj = win32com.client.Dispatch("WbemScripting.SWbemLocator") wmobj = obj.ConnectServer("localhost","root\cimv2") nobj = wmobj.ExecQuery("Select * from Win32_NetworkAdapterConfiguration") for n in nobj: print n.Caption n.SetMTU('9000') When I run this code it errors out with following error : Traceback (most recent call last): File "", line 3, in n.SetMTU('9000') File"C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 505, in getattr ret = self.oleobj.Invoke(retEntry.dispid,0,invoke_type,1) com_error: (-2147352567, 'Exception occurred.', (0, u'SWbemObjectEx', u'Invalid method ',None, 0, -2147217362), None) I did some more debugging and found that I can access any variables of Win32Networking class but whenever I try to call any method of the class it returns me this same error. From jacobk at mailzone.co.za Mon Nov 28 08:33:09 2011 From: jacobk at mailzone.co.za (Jacob Kruger) Date: Mon, 28 Nov 2011 09:33:09 +0200 Subject: [python-win32] MySQL connection/admin tool In-Reply-To: References: Message-ID: <845ABA6AD5E2474980D52B9AF394D717@jakes> Ok, here seems to be quite a nice, sort of step-by-step bit of reference/tutorial material related to making use of MySQLdb, etc.: http://www.kitebird.com/articles/pydbapi.html Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' ----- Original Message ----- From: Vernon Cole To: Jacob Kruger Cc: python-win32 at python.org Sent: Friday, November 25, 2011 7:32 PM Subject: Re: [python-win32] MySQL connection/admin tool Jacob: adodbapi provides an extended dbapi 2.0 (PEP 249) connection to many databases, MySQL is one of the ones I test with regularly. It is included in pywin32. Just "import adodbapi" to use it. (You do have to install the MySQL ODBC driver.) The other packages you mention are MySQL specific, and may have more features specific to MySQL, I don't know ... I've never tried them. Examples of PEP 249 use can be found on Google search "python database api example". Examples of adodbapi use are in the "tests" folder under site_packages/adodbapi -- see also http://sourceforge.net/projects/adodbapi/ good luck -- Vernon On Fri, Nov 25, 2011 at 7:33 AM, Jacob Kruger wrote: Busy now building a sort of MySQL admin interface, and installed MySQL-python-1.2.3.win32-py2.7.exe, and see it includes both the basic mysql module, as well as something called MySQLdb which is some sort of a wrapper or something, but anyway. Anyway, was just wondering if there are specific ways it would be better to connect to a MySQL database/server, and if there are commonly used examples out there, since didn't seem to find any off hand, and this is starting to come together, but, just wondering..? Stay well Jacob Kruger Blind Biker Skype: BlindZA '...fate had broken his body, but not his spirit...' _______________________________________________ python-win32 mailing list python-win32 at python.org http://mail.python.org/mailman/listinfo/python-win32 -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Mon Nov 28 19:15:26 2011 From: timr at probo.com (Tim Roberts) Date: Mon, 28 Nov 2011 10:15:26 -0800 Subject: [python-win32] MySQL connection/admin tool In-Reply-To: References: Message-ID: <4ED3CFBE.8090202@probo.com> Jacob Kruger wrote: > Busy now building a sort of MySQL admin interface, and installed > MySQL-python-1.2.3.win32-py2.7.exe, and see it includes both the basic > mysql module, as well as something called MySQLdb which is some sort > of a wrapper or something, but anyway. > > Anyway, was just wondering if there are specific ways it would be > better to connect to a MySQL database/server, and if there are > commonly used examples out there, since didn't seem to find any off > hand, and this is starting to come together, but, just wondering..? MySQLdb is a basic but functional database connector. It is specific to MySQL. Personally, I prefer "oursql" because it is a little more refined, but both will get the job done Both will work in either Windows or Linux. The ADODB API is a more general; it uses a database driver that gets installed in the operating system, so the API is the same for any database server it supports, and it supports a lot of them. However, it is Windows only (as far as I know). Virtually all Python database APIs have the same basic model. You call a single "connect" function to get a database object. You ask that object for a "cursor". You call the cursor's "execute" method to run an SQL query. Then you use methods like "fetchone" and "fetchall" to retrieve the records one by one. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc.