pywin32-bugs Mailing List for Python for Windows Extensions (Page 8)
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(24) |
May
(19) |
Jun
(15) |
Jul
(43) |
Aug
(39) |
Sep
(25) |
Oct
(43) |
Nov
(19) |
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(21) |
Feb
(18) |
Mar
(14) |
Apr
(80) |
May
(56) |
Jun
(24) |
Jul
(30) |
Aug
(17) |
Sep
(36) |
Oct
(106) |
Nov
(38) |
Dec
(30) |
2005 |
Jan
(14) |
Feb
(14) |
Mar
(48) |
Apr
(28) |
May
(49) |
Jun
(23) |
Jul
(9) |
Aug
(13) |
Sep
(28) |
Oct
(21) |
Nov
(8) |
Dec
(26) |
2006 |
Jan
(56) |
Feb
(33) |
Mar
(33) |
Apr
(18) |
May
(16) |
Jun
(9) |
Jul
(24) |
Aug
(16) |
Sep
(14) |
Oct
(37) |
Nov
(38) |
Dec
(22) |
2007 |
Jan
(7) |
Feb
(16) |
Mar
(11) |
Apr
(15) |
May
(15) |
Jun
(8) |
Jul
(24) |
Aug
(26) |
Sep
(18) |
Oct
(11) |
Nov
(20) |
Dec
(1) |
2008 |
Jan
(19) |
Feb
(55) |
Mar
(7) |
Apr
(35) |
May
(66) |
Jun
(38) |
Jul
(26) |
Aug
(5) |
Sep
(25) |
Oct
(25) |
Nov
(18) |
Dec
(18) |
2009 |
Jan
(25) |
Feb
(38) |
Mar
(29) |
Apr
(25) |
May
(5) |
Jun
(11) |
Jul
(16) |
Aug
(16) |
Sep
(16) |
Oct
(1) |
Nov
(15) |
Dec
(33) |
2010 |
Jan
(13) |
Feb
(11) |
Mar
(1) |
Apr
(24) |
May
(26) |
Jun
(19) |
Jul
(22) |
Aug
(51) |
Sep
(38) |
Oct
(39) |
Nov
(25) |
Dec
(27) |
2011 |
Jan
(40) |
Feb
(31) |
Mar
(21) |
Apr
(42) |
May
(11) |
Jun
(16) |
Jul
(20) |
Aug
(14) |
Sep
(6) |
Oct
(8) |
Nov
(34) |
Dec
(7) |
2012 |
Jan
(60) |
Feb
(24) |
Mar
(6) |
Apr
(28) |
May
(41) |
Jun
(15) |
Jul
(14) |
Aug
(25) |
Sep
(30) |
Oct
(18) |
Nov
(30) |
Dec
(9) |
2013 |
Jan
(3) |
Feb
(8) |
Mar
(17) |
Apr
(23) |
May
(34) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
From: SourceForge.net <no...@so...> - 2012-08-30 11:51:24
|
Bugs item #3562879, was opened at 2012-08-29 08:34 Message generated for change (Comment added) made by fraca7 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3562879&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: com Group: None Status: Pending Resolution: None Priority: 5 Private: No Submitted By: Raveesh (spaniard81) Assigned to: Nobody/Anonymous (nobody) Summary: win32com and PAMIE 3 Initial Comment: I am trying to run the Simple Example to automate a google search on "Python" http://mail.python.org/pipermail/python-announce-list/2009-March/007279.html ###################################################### from PAM30 import PAMIE ie = PAMIE() ie.navigate("google.com") ie.setTextBox("q", "python") ie.clickButton("Google Search") ie.clickLink("Python Programming Language -- Official Website") ###################################################### I have the exact same setup as mentioned in the note by Rob Marchetti. Note:This version only only works with Python 3.0 on Windows and requires Mark Hammond's pywin32 for Python3.0 - pywin32-213.win32-py3.0.exe But i get the following error: TypeError: getElementsByTagName() takes exactly 1 positional argument (2 given) Details: Traceback (most recent call last): File "testPAM.py", line 10, in <module> ie.setTextBox("q", "python") File "C:\Users\raveesh\Dropbox\myCode\SSSB\PAM30.py", line 2093, in setTextBox foundElement = self.getTextBox(name) File "C:\Users\raveesh\Dropbox\myCode\SSSB\PAM30.py", line 1717, in getTextBox foundElement = self.findElement("input", "id;name;value", name) File "C:\Users\raveesh\Dropbox\myCode\SSSB\PAM30.py", line 445, in findElement elements = self.getElementsList(tag) File "C:\Users\raveesh\Dropbox\myCode\SSSB\PAM30.py", line 939, in getElementsList elements = self._ie.Document.getElementsByTagName(tag) TypeError: getElementsByTagName() takes exactly 1 positional argument (2 given) Python on my machine: Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit (Intel)] on win32 The bug has also been reported on http://stackoverflow.com/questions/11580340/typeerror-with-pamie with no solution! ---------------------------------------------------------------------- Comment By: Jérome Laheurte (fraca7) Date: 2012-08-30 04:51 Message: This has nothing to do with Python 3 or PAM. I get the same error using this script (with Python 2.2, win32all build 210, as well as Python 2.5 and win32all build 217). It only happens with MSIE 9. Fun thing is that on a site like Baidu (commented line here), which uses compatibility mode IFAIK, it works. Tested on Win7 Ultimate 32 bits. import win32com.client import time ie = win32com.client.Dispatch('InternetExplorer.Application.1') try: ie.Visible = 1 ie.Navigate("http://www.google.com") # ie.Navigate("http://www.baidu.com") while ie.Busy: time.sleep(1) print ie.Document.getElementsByTagName("a") finally: ie.Quit() ---------------------------------------------------------------------- Comment By: Raveesh (spaniard81) Date: 2012-08-30 02:22 Message: i am running this on a 64bit Win7, Intel machine, if that has anything to do with this. ---------------------------------------------------------------------- Comment By: Raveesh (spaniard81) Date: 2012-08-30 02:21 Message: Hi, following you suggestion i upgraded to Python 3.x. Here is the exact version: Python 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)] on win32 And i have installed pywin32-217.win32-py3.2 from sourceforge I still get the same TypeError: getElementsByTagName() takes exactly 1 positional argument (2 given) ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2012-08-29 09:03 Message: The first thing to try is using a newer version of Python 3. There were enough problems with Python 3.0 that pywin32 is no longer released for it. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3562879&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-30 09:22:22
|
Bugs item #3562879, was opened at 2012-08-29 08:34 Message generated for change (Comment added) made by spaniard81 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3562879&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: com Group: None Status: Pending Resolution: None Priority: 5 Private: No Submitted By: Raveesh (spaniard81) Assigned to: Nobody/Anonymous (nobody) Summary: win32com and PAMIE 3 Initial Comment: I am trying to run the Simple Example to automate a google search on "Python" http://mail.python.org/pipermail/python-announce-list/2009-March/007279.html ###################################################### from PAM30 import PAMIE ie = PAMIE() ie.navigate("google.com") ie.setTextBox("q", "python") ie.clickButton("Google Search") ie.clickLink("Python Programming Language -- Official Website") ###################################################### I have the exact same setup as mentioned in the note by Rob Marchetti. Note:This version only only works with Python 3.0 on Windows and requires Mark Hammond's pywin32 for Python3.0 - pywin32-213.win32-py3.0.exe But i get the following error: TypeError: getElementsByTagName() takes exactly 1 positional argument (2 given) Details: Traceback (most recent call last): File "testPAM.py", line 10, in <module> ie.setTextBox("q", "python") File "C:\Users\raveesh\Dropbox\myCode\SSSB\PAM30.py", line 2093, in setTextBox foundElement = self.getTextBox(name) File "C:\Users\raveesh\Dropbox\myCode\SSSB\PAM30.py", line 1717, in getTextBox foundElement = self.findElement("input", "id;name;value", name) File "C:\Users\raveesh\Dropbox\myCode\SSSB\PAM30.py", line 445, in findElement elements = self.getElementsList(tag) File "C:\Users\raveesh\Dropbox\myCode\SSSB\PAM30.py", line 939, in getElementsList elements = self._ie.Document.getElementsByTagName(tag) TypeError: getElementsByTagName() takes exactly 1 positional argument (2 given) Python on my machine: Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit (Intel)] on win32 The bug has also been reported on http://stackoverflow.com/questions/11580340/typeerror-with-pamie with no solution! ---------------------------------------------------------------------- Comment By: Raveesh (spaniard81) Date: 2012-08-30 02:22 Message: i am running this on a 64bit Win7, Intel machine, if that has anything to do with this. ---------------------------------------------------------------------- Comment By: Raveesh (spaniard81) Date: 2012-08-30 02:21 Message: Hi, following you suggestion i upgraded to Python 3.x. Here is the exact version: Python 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)] on win32 And i have installed pywin32-217.win32-py3.2 from sourceforge I still get the same TypeError: getElementsByTagName() takes exactly 1 positional argument (2 given) ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2012-08-29 09:03 Message: The first thing to try is using a newer version of Python 3. There were enough problems with Python 3.0 that pywin32 is no longer released for it. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3562879&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-30 09:21:04
|
Bugs item #3562879, was opened at 2012-08-29 08:34 Message generated for change (Comment added) made by spaniard81 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3562879&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: com Group: None Status: Pending Resolution: None Priority: 5 Private: No Submitted By: Raveesh (spaniard81) Assigned to: Nobody/Anonymous (nobody) Summary: win32com and PAMIE 3 Initial Comment: I am trying to run the Simple Example to automate a google search on "Python" http://mail.python.org/pipermail/python-announce-list/2009-March/007279.html ###################################################### from PAM30 import PAMIE ie = PAMIE() ie.navigate("google.com") ie.setTextBox("q", "python") ie.clickButton("Google Search") ie.clickLink("Python Programming Language -- Official Website") ###################################################### I have the exact same setup as mentioned in the note by Rob Marchetti. Note:This version only only works with Python 3.0 on Windows and requires Mark Hammond's pywin32 for Python3.0 - pywin32-213.win32-py3.0.exe But i get the following error: TypeError: getElementsByTagName() takes exactly 1 positional argument (2 given) Details: Traceback (most recent call last): File "testPAM.py", line 10, in <module> ie.setTextBox("q", "python") File "C:\Users\raveesh\Dropbox\myCode\SSSB\PAM30.py", line 2093, in setTextBox foundElement = self.getTextBox(name) File "C:\Users\raveesh\Dropbox\myCode\SSSB\PAM30.py", line 1717, in getTextBox foundElement = self.findElement("input", "id;name;value", name) File "C:\Users\raveesh\Dropbox\myCode\SSSB\PAM30.py", line 445, in findElement elements = self.getElementsList(tag) File "C:\Users\raveesh\Dropbox\myCode\SSSB\PAM30.py", line 939, in getElementsList elements = self._ie.Document.getElementsByTagName(tag) TypeError: getElementsByTagName() takes exactly 1 positional argument (2 given) Python on my machine: Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit (Intel)] on win32 The bug has also been reported on http://stackoverflow.com/questions/11580340/typeerror-with-pamie with no solution! ---------------------------------------------------------------------- Comment By: Raveesh (spaniard81) Date: 2012-08-30 02:21 Message: Hi, following you suggestion i upgraded to Python 3.x. Here is the exact version: Python 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)] on win32 And i have installed pywin32-217.win32-py3.2 from sourceforge I still get the same TypeError: getElementsByTagName() takes exactly 1 positional argument (2 given) ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2012-08-29 09:03 Message: The first thing to try is using a newer version of Python 3. There were enough problems with Python 3.0 that pywin32 is no longer released for it. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3562879&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-29 23:06:25
|
Bugs item #3562998, was opened at 2012-08-29 14:09 Message generated for change (Comment added) made by rupole You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3562998&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: win32 Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Series8217 (series8217) Assigned to: Nobody/Anonymous (nobody) Summary: Python won't exit if win32ui is imported Initial Comment: Environment: Windows 7 64-bit, Python 2.7.3 32-bit, PyWin32-217 This is a weird one. If you run the attached script (you'll need to manually close the file chooser), you'll find that Python does not exit when the script is done. However, if you remove win32ui from the list of imports, the script exits just fine. Also, if the script consists solely of "import win32gui, win32ui", it exits cleanly. I printed a list of threads and it's just the main thread in both cases. Another user on Stack Overflow found that this problem is reproducible by creating and destroying a GTK Window instead of opening a file chooser like I did. See: http://stackoverflow.com/questions/10467225/why-script-doesnt-quit-when-win32ui-is-imported-and-gtk-quits ---------------------------------------------------------------------- >Comment By: Roger Upole (rupole) Date: 2012-08-29 16:06 Message: I can't reproduce this. How are you launching the script ? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3562998&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-29 21:09:37
|
Bugs item #3562998, was opened at 2012-08-29 14:09 Message generated for change (Tracker Item Submitted) made by series8217 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3562998&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: win32 Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Series8217 (series8217) Assigned to: Nobody/Anonymous (nobody) Summary: Python won't exit if win32ui is imported Initial Comment: Environment: Windows 7 64-bit, Python 2.7.3 32-bit, PyWin32-217 This is a weird one. If you run the attached script (you'll need to manually close the file chooser), you'll find that Python does not exit when the script is done. However, if you remove win32ui from the list of imports, the script exits just fine. Also, if the script consists solely of "import win32gui, win32ui", it exits cleanly. I printed a list of threads and it's just the main thread in both cases. Another user on Stack Overflow found that this problem is reproducible by creating and destroying a GTK Window instead of opening a file chooser like I did. See: http://stackoverflow.com/questions/10467225/why-script-doesnt-quit-when-win32ui-is-imported-and-gtk-quits ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3562998&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-29 16:03:27
|
Bugs item #3562879, was opened at 2012-08-29 08:34 Message generated for change (Comment added) made by rupole You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3562879&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: com Group: None >Status: Pending Resolution: None Priority: 5 Private: No Submitted By: Raveesh (spaniard81) Assigned to: Nobody/Anonymous (nobody) Summary: win32com and PAMIE 3 Initial Comment: I am trying to run the Simple Example to automate a google search on "Python" http://mail.python.org/pipermail/python-announce-list/2009-March/007279.html ###################################################### from PAM30 import PAMIE ie = PAMIE() ie.navigate("google.com") ie.setTextBox("q", "python") ie.clickButton("Google Search") ie.clickLink("Python Programming Language -- Official Website") ###################################################### I have the exact same setup as mentioned in the note by Rob Marchetti. Note:This version only only works with Python 3.0 on Windows and requires Mark Hammond's pywin32 for Python3.0 - pywin32-213.win32-py3.0.exe But i get the following error: TypeError: getElementsByTagName() takes exactly 1 positional argument (2 given) Details: Traceback (most recent call last): File "testPAM.py", line 10, in <module> ie.setTextBox("q", "python") File "C:\Users\raveesh\Dropbox\myCode\SSSB\PAM30.py", line 2093, in setTextBox foundElement = self.getTextBox(name) File "C:\Users\raveesh\Dropbox\myCode\SSSB\PAM30.py", line 1717, in getTextBox foundElement = self.findElement("input", "id;name;value", name) File "C:\Users\raveesh\Dropbox\myCode\SSSB\PAM30.py", line 445, in findElement elements = self.getElementsList(tag) File "C:\Users\raveesh\Dropbox\myCode\SSSB\PAM30.py", line 939, in getElementsList elements = self._ie.Document.getElementsByTagName(tag) TypeError: getElementsByTagName() takes exactly 1 positional argument (2 given) Python on my machine: Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit (Intel)] on win32 The bug has also been reported on http://stackoverflow.com/questions/11580340/typeerror-with-pamie with no solution! ---------------------------------------------------------------------- >Comment By: Roger Upole (rupole) Date: 2012-08-29 09:03 Message: The first thing to try is using a newer version of Python 3. There were enough problems with Python 3.0 that pywin32 is no longer released for it. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3562879&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-29 15:34:52
|
Bugs item #3562879, was opened at 2012-08-29 08:34 Message generated for change (Tracker Item Submitted) made by spaniard81 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3562879&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: win32 Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Raveesh (spaniard81) Assigned to: Nobody/Anonymous (nobody) Summary: win32com and PAMIE 3 Initial Comment: I am trying to run the Simple Example to automate a google search on "Python" http://mail.python.org/pipermail/python-announce-list/2009-March/007279.html ###################################################### from PAM30 import PAMIE ie = PAMIE() ie.navigate("google.com") ie.setTextBox("q", "python") ie.clickButton("Google Search") ie.clickLink("Python Programming Language -- Official Website") ###################################################### I have the exact same setup as mentioned in the note by Rob Marchetti. Note:This version only only works with Python 3.0 on Windows and requires Mark Hammond's pywin32 for Python3.0 - pywin32-213.win32-py3.0.exe But i get the following error: TypeError: getElementsByTagName() takes exactly 1 positional argument (2 given) Details: Traceback (most recent call last): File "testPAM.py", line 10, in <module> ie.setTextBox("q", "python") File "C:\Users\raveesh\Dropbox\myCode\SSSB\PAM30.py", line 2093, in setTextBox foundElement = self.getTextBox(name) File "C:\Users\raveesh\Dropbox\myCode\SSSB\PAM30.py", line 1717, in getTextBox foundElement = self.findElement("input", "id;name;value", name) File "C:\Users\raveesh\Dropbox\myCode\SSSB\PAM30.py", line 445, in findElement elements = self.getElementsList(tag) File "C:\Users\raveesh\Dropbox\myCode\SSSB\PAM30.py", line 939, in getElementsList elements = self._ie.Document.getElementsByTagName(tag) TypeError: getElementsByTagName() takes exactly 1 positional argument (2 given) Python on my machine: Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit (Intel)] on win32 The bug has also been reported on http://stackoverflow.com/questions/11580340/typeerror-with-pamie with no solution! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3562879&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-20 06:55:06
|
Bugs item #3356683, was opened at 2011-07-06 10:05 Message generated for change (Comment added) made by ssfjhh You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3356683&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: installation Group: None Status: Pending Resolution: None Priority: 5 Private: No Submitted By: LMO (rzn8tr) Assigned to: Nobody/Anonymous (nobody) Summary: Import Error: DLL load Failed Win XP Pro Initial Comment: Installed python 2.7, installed pywin32-216 without problems Uninstalled python 2.7, pywin32 Installed python 2.6 When installing pywin32-216 (or -215, same result), setup dialog shows: Traceback (most recent call last): File "<string>", line 604, in <module> File "<string>", line 314, in install File "<string>", line 152, in LoadSystemModule ImportError: DLL load failed: The specified module could not be found. ---------------------------------------------------------------------- Comment By: ssfjhh (ssfjhh) Date: 2012-08-19 23:55 Message: I am having the same problem. Having redistributables does not work.import win32api win7 x64 python3.3b02 amd64 pywin32 amd64 py33 ---------------------------------------------------------------------- Comment By: chintan (chintanvj) Date: 2011-12-06 13:08 Message: Hi, I am having the same problem. Having redistributables does not work. Thanks for the effort ---------------------------------------------------------------------- Comment By: http://jibinjohn.myopenid.com/ () Date: 2011-10-12 02:48 Message: @mhammond pywin32-216.win32-py2.6.exe ---------------------------------------------------------------------- Comment By: http://jibinjohn.myopenid.com/ () Date: 2011-10-12 02:45 Message: @mhammond I tried that its not working.Same error Windows xp professional sp3 python 2.6 (r26:66721, Oct 2 2008, 11:35:03) [MSC v.1500 32 bit (Intel)] ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2011-07-06 16:12 Message: I suspect you need the VS redistributables from http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=29 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3356683&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-19 22:58:44
|
Bugs item #3559330, was opened at 2012-08-18 19:16 Message generated for change (Comment added) made by pgawlowski You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3559330&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: installation Group: None >Status: Closed Resolution: None Priority: 5 Private: No Submitted By: Phillip Gawlowski (pgawlowski) Assigned to: Nobody/Anonymous (nobody) Summary: postinstall script will not execute properly as non-admin Initial Comment: The postinstall script produces the following output for a user without administration rights: c:\Coding\Python\2.7\Scripts>pywin32_postinstall.py -install pywin32_postinstall.py: A post-install script for the pywin32 extensions. This should be run automatically after installation, but if it fails you can run it again with a '-install' parameter, to ensure the environment is setup correctly. Additional Options: -wait pid : Wait for the specified process to terminate before starting. -silent : Don't display the "Abort/Retry/Ignore" dialog for files in use. -quiet : Don't display progress messages. Platform: Windows 8 64 bit CP Python: 2.7 32bit When the testall script is executed from a console launched as administrator, the tests run (I didn't finish the test run, as I wanted to know if the install completed at all). The expected behaviour is that the postinstall script adds all necessary settings to the currently logged in user rather than failing with a non-error. ---------------------------------------------------------------------- >Comment By: Phillip Gawlowski (pgawlowski) Date: 2012-08-19 15:58 Message: PEBKAC: Python 2.6 was hogging the .py extensions, not Python 2.7 as assumed. My apologies for the noise. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3559330&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-19 17:02:58
|
Bugs item #3555112, was opened at 2012-08-07 07:19 Message generated for change (Comment added) made by rupole You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: com Group: None Status: Closed Resolution: Works For Me Priority: 5 Private: No Submitted By: franckgaga () Assigned to: Nobody/Anonymous (nobody) Summary: EnsureDispatch error 2147352567 but not Dispatch Initial Comment: I've got a strange problem : I'e trying to export Outlook Contacts in a List of Dictionnary. My code works perfectly with win32com.client.Dispatch("Outlook.Application). But it returns 0 contacts with win32com.client.gencache.EnsureDispatch("Outlook.Application) that is supposed to be faster and "safer". Here's my code : class MapiImport(): def __init__(self): self.olApp = win32com.client.Dispatch("Outlook.Application") self.namespace = self.olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : self.mapiContacts = self.namespace.GetDefaultFolder(10).Items def getContacts(self, *fields): contacts = [] # Class == 40 is ContactItem # Class == 69 is DistListItem # Exclude ditribution list and others objects != ContactItem for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : if not fields : ctact = dict((x.Name,x.Value) for x in contact.ItemProperties) else : ctact = {} for field in fields : itemProp = contact.itemProperties[field] ctact[field] = itemProp.Value contacts.append(ctact) return contacts #====TEST SCRIPT==== myMAPI = MapiImport() fields = (u"LastName",u"FirstName",u"Companies", u"HomeTelephoneNumber",u"Home2TelephoneNumber", u"MobileTelephoneNumber", u"BusinessTelephoneNumber",u"Business2TelephoneNumber", u"Email1Address",u"Email2Address",u"Email3Address", u"HomeAddress",u"BusinessAddress", u"Birthday",u"Anniversary", u"Body") print(myMAPI.getContacts(*fields)) So when i replace : olApp = win32com.client.Dispatch("Outlook.Application") With : olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") It returns this errors : Traceback (most recent call last): File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 42, in <module> print(myMAPI.getContacts(*fields)) File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 19, in getContacts for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : File "D:\Documents and Settings\da7950\Mes documents\Python27\lib\site-packages\win32com\gen_py\00062FFF-0000-0000-C000-000000000046x0x9x2\_Items.py", line 122, in __getitem__ return self._get_good_object_(self._oleobj_.Invoke(*(81, LCID, 1, 1, item)), "Item") com_error: (-2147352567, "Une exception s'est produite.", (4096, u'Microsoft Office Outlook', u'Index de la matrice en dehors des limites.', None, 0, -2147352567), None) The message means "Matrix index out of bounds". The strangiest thing is that after I called EnsureDispatch, win32com.client.Dispatch doesn't works anymore. I have to uninstall pywin32 and reinstall it... I'm running with Python2.7.3 32-bit with Outlook 2003 32-bit Thanks ---------------------------------------------------------------------- >Comment By: Roger Upole (rupole) Date: 2012-08-19 10:02 Message: Makepy generated classes now check for an enumerator at runtime, so in the future you shouldn't need to use dynamic in these cases. ---------------------------------------------------------------------- Comment By: franckgaga () Date: 2012-08-09 06:41 Message: Found it ! EnsureDispatch is way faster and "framed" ! All the properties must be spelled exactly as the MSDN doc. i.e. with a MAJ at the beginning : contact.ItemPrperties works but not contact.itemProperties (with normal dispatch, it's not case sensitive) Thx again ! ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-08 16:26 Message: I don't know the outlook object model well enough to say - you might like to try mailing the python-win32 mailing list to see what others are doing. ---------------------------------------------------------------------- Comment By: franckgaga () Date: 2012-08-08 07:18 Message: Is it normal that : contact.ItemProperties Doesn't exist anymore with EnsureDispatch ? Is there any other way to list all the fields of a olContactItem with EnsureDispatch ? Thx ---------------------------------------------------------------------- Comment By: franckgaga () Date: 2012-08-08 07:01 Message: So it will be corrected in a future version ? As a workaround, i use : for i in range (1, len(self.mapiContacts)+1): contact = self.mapiContacts[i] Thx 4 everything ! ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 20:58 Message: Sounds good to me! ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2012-08-07 20:45 Message: I took a closer look at this, and the makepy code is checking for the NewEnum method, but it doesn't appear in the TypeInfo. I think the right thing to do would be to always try to Invoke DISPID_NEWENUM first, and fall back to iterating Items if that fails. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 20:21 Message: So it looks like we need to work out why _NewEnum isn't being used in that case, as Roger mentioned. DumpDispatch is just like regular Dispatch when EnsureDispatch hasn't been used. IOW, DumbDispatch will always ignore the magic done by EnsureDispatch. ---------------------------------------------------------------------- Comment By: franckgaga () Date: 2012-08-07 20:04 Message: Thx for fast answer ! you're both right, outlook is using a 1-base index. If i try this simple code : import win32com.client olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") namespace = olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : mapiContacts = namespace.GetDefaultFolder(10).Items print mapiContacts[0] # INDEX 0 CRASHES It crashes with the same error. But if i try with index 1, 2, 3 etc. it works ! My code works with win32com.client.dynamic.DumbDispatch. What's the cons of DumbDispatch ? ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 16:34 Message: oops - I wrote that before seeing Roger's reply... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 16:33 Message: FWIW, EnsureDispatch will generated code into the win32com\client\gen_py directory (or possibly in %temp%\gen_py) - removing that directory should avoid needing to reinstall pywin32 to reset the behaviour. As to the problem itself, can you check if "self.mapiContacts.Items(0)" throws an exception? I'm wondering if the code is looping, but isn't handling the exception to stop the looping correctly (ie, I'm wondering if the code is failing *after* it successfully enumerates the contacts or before). ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2012-08-07 12:10 Message: It appears outlook is using a 1-based index for the contact items. When using the generated wrapper classes, iteration is performed by calling for Items starting with 0, and throws the error you're seeing. The dynamic Dispatch is querying for an iterator using DISPID_NEWENUM, and the resulting enumerator works regardless of the indexing scheme. The makepy generated classes should probably use that same process. As a workaround, you can use win32com.client.dynamic.DumbDispatch to get the dynamic behaviour for just the mapiContacts object. You can remove the makepy support by simply clearing the \win32com\gen_py directory rather than reinstalling. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-19 17:00:34
|
Bugs item #3555177, was opened at 2012-08-07 13:18 Message generated for change (Comment added) made by rupole You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555177&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: com Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Roger Upole (rupole) Assigned to: Nobody/Anonymous (nobody) Summary: makepy can generate invalid syntax Initial Comment: From this question on StackOverflow: http://stackoverflow.com/questions/11630973/makepy-error-xceedzip-dll If a module contains constants whose repr() can't be used as a constructor, it will get written to the generated file anyway, causing a SyntaxError when it's imported. In this case it was a time, generating the invalid code xcdMaximumDate =<PyTime:12/31/9999 12:00:00 AM> # from enum XceedConstants ---------------------------------------------------------------------- >Comment By: Roger Upole (rupole) Date: 2012-08-19 10:00 Message: Syntax is now checked when using the repr of an item ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555177&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-19 02:16:57
|
Bugs item #3559330, was opened at 2012-08-18 19:16 Message generated for change (Tracker Item Submitted) made by pgawlowski You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3559330&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: installation Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Phillip Gawlowski (pgawlowski) Assigned to: Nobody/Anonymous (nobody) Summary: postinstall script will not execute properly as non-admin Initial Comment: The postinstall script produces the following output for a user without administration rights: c:\Coding\Python\2.7\Scripts>pywin32_postinstall.py -install pywin32_postinstall.py: A post-install script for the pywin32 extensions. This should be run automatically after installation, but if it fails you can run it again with a '-install' parameter, to ensure the environment is setup correctly. Additional Options: -wait pid : Wait for the specified process to terminate before starting. -silent : Don't display the "Abort/Retry/Ignore" dialog for files in use. -quiet : Don't display progress messages. Platform: Windows 8 64 bit CP Python: 2.7 32bit When the testall script is executed from a console launched as administrator, the tests run (I didn't finish the test run, as I wanted to know if the install completed at all). The expected behaviour is that the postinstall script adds all necessary settings to the currently logged in user rather than failing with a non-error. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3559330&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-09 13:41:46
|
Bugs item #3555112, was opened at 2012-08-07 07:19 Message generated for change (Settings changed) made by You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: com Group: None >Status: Closed >Resolution: Works For Me Priority: 5 Private: No Submitted By: franckgaga () Assigned to: Nobody/Anonymous (nobody) Summary: EnsureDispatch error 2147352567 but not Dispatch Initial Comment: I've got a strange problem : I'e trying to export Outlook Contacts in a List of Dictionnary. My code works perfectly with win32com.client.Dispatch("Outlook.Application). But it returns 0 contacts with win32com.client.gencache.EnsureDispatch("Outlook.Application) that is supposed to be faster and "safer". Here's my code : class MapiImport(): def __init__(self): self.olApp = win32com.client.Dispatch("Outlook.Application") self.namespace = self.olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : self.mapiContacts = self.namespace.GetDefaultFolder(10).Items def getContacts(self, *fields): contacts = [] # Class == 40 is ContactItem # Class == 69 is DistListItem # Exclude ditribution list and others objects != ContactItem for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : if not fields : ctact = dict((x.Name,x.Value) for x in contact.ItemProperties) else : ctact = {} for field in fields : itemProp = contact.itemProperties[field] ctact[field] = itemProp.Value contacts.append(ctact) return contacts #====TEST SCRIPT==== myMAPI = MapiImport() fields = (u"LastName",u"FirstName",u"Companies", u"HomeTelephoneNumber",u"Home2TelephoneNumber", u"MobileTelephoneNumber", u"BusinessTelephoneNumber",u"Business2TelephoneNumber", u"Email1Address",u"Email2Address",u"Email3Address", u"HomeAddress",u"BusinessAddress", u"Birthday",u"Anniversary", u"Body") print(myMAPI.getContacts(*fields)) So when i replace : olApp = win32com.client.Dispatch("Outlook.Application") With : olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") It returns this errors : Traceback (most recent call last): File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 42, in <module> print(myMAPI.getContacts(*fields)) File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 19, in getContacts for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : File "D:\Documents and Settings\da7950\Mes documents\Python27\lib\site-packages\win32com\gen_py\00062FFF-0000-0000-C000-000000000046x0x9x2\_Items.py", line 122, in __getitem__ return self._get_good_object_(self._oleobj_.Invoke(*(81, LCID, 1, 1, item)), "Item") com_error: (-2147352567, "Une exception s'est produite.", (4096, u'Microsoft Office Outlook', u'Index de la matrice en dehors des limites.', None, 0, -2147352567), None) The message means "Matrix index out of bounds". The strangiest thing is that after I called EnsureDispatch, win32com.client.Dispatch doesn't works anymore. I have to uninstall pywin32 and reinstall it... I'm running with Python2.7.3 32-bit with Outlook 2003 32-bit Thanks ---------------------------------------------------------------------- >Comment By: franckgaga () Date: 2012-08-09 06:41 Message: Found it ! EnsureDispatch is way faster and "framed" ! All the properties must be spelled exactly as the MSDN doc. i.e. with a MAJ at the beginning : contact.ItemPrperties works but not contact.itemProperties (with normal dispatch, it's not case sensitive) Thx again ! ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-08 16:26 Message: I don't know the outlook object model well enough to say - you might like to try mailing the python-win32 mailing list to see what others are doing. ---------------------------------------------------------------------- Comment By: franckgaga () Date: 2012-08-08 07:18 Message: Is it normal that : contact.ItemProperties Doesn't exist anymore with EnsureDispatch ? Is there any other way to list all the fields of a olContactItem with EnsureDispatch ? Thx ---------------------------------------------------------------------- Comment By: franckgaga () Date: 2012-08-08 07:01 Message: So it will be corrected in a future version ? As a workaround, i use : for i in range (1, len(self.mapiContacts)+1): contact = self.mapiContacts[i] Thx 4 everything ! ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 20:58 Message: Sounds good to me! ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2012-08-07 20:45 Message: I took a closer look at this, and the makepy code is checking for the NewEnum method, but it doesn't appear in the TypeInfo. I think the right thing to do would be to always try to Invoke DISPID_NEWENUM first, and fall back to iterating Items if that fails. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 20:21 Message: So it looks like we need to work out why _NewEnum isn't being used in that case, as Roger mentioned. DumpDispatch is just like regular Dispatch when EnsureDispatch hasn't been used. IOW, DumbDispatch will always ignore the magic done by EnsureDispatch. ---------------------------------------------------------------------- Comment By: franckgaga () Date: 2012-08-07 20:04 Message: Thx for fast answer ! you're both right, outlook is using a 1-base index. If i try this simple code : import win32com.client olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") namespace = olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : mapiContacts = namespace.GetDefaultFolder(10).Items print mapiContacts[0] # INDEX 0 CRASHES It crashes with the same error. But if i try with index 1, 2, 3 etc. it works ! My code works with win32com.client.dynamic.DumbDispatch. What's the cons of DumbDispatch ? ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 16:34 Message: oops - I wrote that before seeing Roger's reply... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 16:33 Message: FWIW, EnsureDispatch will generated code into the win32com\client\gen_py directory (or possibly in %temp%\gen_py) - removing that directory should avoid needing to reinstall pywin32 to reset the behaviour. As to the problem itself, can you check if "self.mapiContacts.Items(0)" throws an exception? I'm wondering if the code is looping, but isn't handling the exception to stop the looping correctly (ie, I'm wondering if the code is failing *after* it successfully enumerates the contacts or before). ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2012-08-07 12:10 Message: It appears outlook is using a 1-based index for the contact items. When using the generated wrapper classes, iteration is performed by calling for Items starting with 0, and throws the error you're seeing. The dynamic Dispatch is querying for an iterator using DISPID_NEWENUM, and the resulting enumerator works regardless of the indexing scheme. The makepy generated classes should probably use that same process. As a workaround, you can use win32com.client.dynamic.DumbDispatch to get the dynamic behaviour for just the mapiContacts object. You can remove the makepy support by simply clearing the \win32com\gen_py directory rather than reinstalling. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-08 23:26:22
|
Bugs item #3555112, was opened at 2012-08-07 07:19 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: com Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: franckgaga () Assigned to: Nobody/Anonymous (nobody) Summary: EnsureDispatch error 2147352567 but not Dispatch Initial Comment: I've got a strange problem : I'e trying to export Outlook Contacts in a List of Dictionnary. My code works perfectly with win32com.client.Dispatch("Outlook.Application). But it returns 0 contacts with win32com.client.gencache.EnsureDispatch("Outlook.Application) that is supposed to be faster and "safer". Here's my code : class MapiImport(): def __init__(self): self.olApp = win32com.client.Dispatch("Outlook.Application") self.namespace = self.olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : self.mapiContacts = self.namespace.GetDefaultFolder(10).Items def getContacts(self, *fields): contacts = [] # Class == 40 is ContactItem # Class == 69 is DistListItem # Exclude ditribution list and others objects != ContactItem for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : if not fields : ctact = dict((x.Name,x.Value) for x in contact.ItemProperties) else : ctact = {} for field in fields : itemProp = contact.itemProperties[field] ctact[field] = itemProp.Value contacts.append(ctact) return contacts #====TEST SCRIPT==== myMAPI = MapiImport() fields = (u"LastName",u"FirstName",u"Companies", u"HomeTelephoneNumber",u"Home2TelephoneNumber", u"MobileTelephoneNumber", u"BusinessTelephoneNumber",u"Business2TelephoneNumber", u"Email1Address",u"Email2Address",u"Email3Address", u"HomeAddress",u"BusinessAddress", u"Birthday",u"Anniversary", u"Body") print(myMAPI.getContacts(*fields)) So when i replace : olApp = win32com.client.Dispatch("Outlook.Application") With : olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") It returns this errors : Traceback (most recent call last): File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 42, in <module> print(myMAPI.getContacts(*fields)) File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 19, in getContacts for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : File "D:\Documents and Settings\da7950\Mes documents\Python27\lib\site-packages\win32com\gen_py\00062FFF-0000-0000-C000-000000000046x0x9x2\_Items.py", line 122, in __getitem__ return self._get_good_object_(self._oleobj_.Invoke(*(81, LCID, 1, 1, item)), "Item") com_error: (-2147352567, "Une exception s'est produite.", (4096, u'Microsoft Office Outlook', u'Index de la matrice en dehors des limites.', None, 0, -2147352567), None) The message means "Matrix index out of bounds". The strangiest thing is that after I called EnsureDispatch, win32com.client.Dispatch doesn't works anymore. I have to uninstall pywin32 and reinstall it... I'm running with Python2.7.3 32-bit with Outlook 2003 32-bit Thanks ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2012-08-08 16:26 Message: I don't know the outlook object model well enough to say - you might like to try mailing the python-win32 mailing list to see what others are doing. ---------------------------------------------------------------------- Comment By: franckgaga () Date: 2012-08-08 07:18 Message: Is it normal that : contact.ItemProperties Doesn't exist anymore with EnsureDispatch ? Is there any other way to list all the fields of a olContactItem with EnsureDispatch ? Thx ---------------------------------------------------------------------- Comment By: franckgaga () Date: 2012-08-08 07:01 Message: So it will be corrected in a future version ? As a workaround, i use : for i in range (1, len(self.mapiContacts)+1): contact = self.mapiContacts[i] Thx 4 everything ! ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 20:58 Message: Sounds good to me! ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2012-08-07 20:45 Message: I took a closer look at this, and the makepy code is checking for the NewEnum method, but it doesn't appear in the TypeInfo. I think the right thing to do would be to always try to Invoke DISPID_NEWENUM first, and fall back to iterating Items if that fails. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 20:21 Message: So it looks like we need to work out why _NewEnum isn't being used in that case, as Roger mentioned. DumpDispatch is just like regular Dispatch when EnsureDispatch hasn't been used. IOW, DumbDispatch will always ignore the magic done by EnsureDispatch. ---------------------------------------------------------------------- Comment By: franckgaga () Date: 2012-08-07 20:04 Message: Thx for fast answer ! you're both right, outlook is using a 1-base index. If i try this simple code : import win32com.client olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") namespace = olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : mapiContacts = namespace.GetDefaultFolder(10).Items print mapiContacts[0] # INDEX 0 CRASHES It crashes with the same error. But if i try with index 1, 2, 3 etc. it works ! My code works with win32com.client.dynamic.DumbDispatch. What's the cons of DumbDispatch ? ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 16:34 Message: oops - I wrote that before seeing Roger's reply... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 16:33 Message: FWIW, EnsureDispatch will generated code into the win32com\client\gen_py directory (or possibly in %temp%\gen_py) - removing that directory should avoid needing to reinstall pywin32 to reset the behaviour. As to the problem itself, can you check if "self.mapiContacts.Items(0)" throws an exception? I'm wondering if the code is looping, but isn't handling the exception to stop the looping correctly (ie, I'm wondering if the code is failing *after* it successfully enumerates the contacts or before). ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2012-08-07 12:10 Message: It appears outlook is using a 1-based index for the contact items. When using the generated wrapper classes, iteration is performed by calling for Items starting with 0, and throws the error you're seeing. The dynamic Dispatch is querying for an iterator using DISPID_NEWENUM, and the resulting enumerator works regardless of the indexing scheme. The makepy generated classes should probably use that same process. As a workaround, you can use win32com.client.dynamic.DumbDispatch to get the dynamic behaviour for just the mapiContacts object. You can remove the makepy support by simply clearing the \win32com\gen_py directory rather than reinstalling. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-08 14:18:13
|
Bugs item #3555112, was opened at 2012-08-07 07:19 Message generated for change (Comment added) made by You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: com Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: franckgaga () Assigned to: Nobody/Anonymous (nobody) Summary: EnsureDispatch error 2147352567 but not Dispatch Initial Comment: I've got a strange problem : I'e trying to export Outlook Contacts in a List of Dictionnary. My code works perfectly with win32com.client.Dispatch("Outlook.Application). But it returns 0 contacts with win32com.client.gencache.EnsureDispatch("Outlook.Application) that is supposed to be faster and "safer". Here's my code : class MapiImport(): def __init__(self): self.olApp = win32com.client.Dispatch("Outlook.Application") self.namespace = self.olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : self.mapiContacts = self.namespace.GetDefaultFolder(10).Items def getContacts(self, *fields): contacts = [] # Class == 40 is ContactItem # Class == 69 is DistListItem # Exclude ditribution list and others objects != ContactItem for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : if not fields : ctact = dict((x.Name,x.Value) for x in contact.ItemProperties) else : ctact = {} for field in fields : itemProp = contact.itemProperties[field] ctact[field] = itemProp.Value contacts.append(ctact) return contacts #====TEST SCRIPT==== myMAPI = MapiImport() fields = (u"LastName",u"FirstName",u"Companies", u"HomeTelephoneNumber",u"Home2TelephoneNumber", u"MobileTelephoneNumber", u"BusinessTelephoneNumber",u"Business2TelephoneNumber", u"Email1Address",u"Email2Address",u"Email3Address", u"HomeAddress",u"BusinessAddress", u"Birthday",u"Anniversary", u"Body") print(myMAPI.getContacts(*fields)) So when i replace : olApp = win32com.client.Dispatch("Outlook.Application") With : olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") It returns this errors : Traceback (most recent call last): File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 42, in <module> print(myMAPI.getContacts(*fields)) File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 19, in getContacts for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : File "D:\Documents and Settings\da7950\Mes documents\Python27\lib\site-packages\win32com\gen_py\00062FFF-0000-0000-C000-000000000046x0x9x2\_Items.py", line 122, in __getitem__ return self._get_good_object_(self._oleobj_.Invoke(*(81, LCID, 1, 1, item)), "Item") com_error: (-2147352567, "Une exception s'est produite.", (4096, u'Microsoft Office Outlook', u'Index de la matrice en dehors des limites.', None, 0, -2147352567), None) The message means "Matrix index out of bounds". The strangiest thing is that after I called EnsureDispatch, win32com.client.Dispatch doesn't works anymore. I have to uninstall pywin32 and reinstall it... I'm running with Python2.7.3 32-bit with Outlook 2003 32-bit Thanks ---------------------------------------------------------------------- Comment By: franckgaga () Date: 2012-08-08 07:18 Message: Is it normal that : contact.ItemProperties Doesn't exist anymore with EnsureDispatch ? Is there any other way to list all the fields of a olContactItem with EnsureDispatch ? Thx ---------------------------------------------------------------------- Comment By: franckgaga () Date: 2012-08-08 07:01 Message: So it will be corrected in a future version ? As a workaround, i use : for i in range (1, len(self.mapiContacts)+1): contact = self.mapiContacts[i] Thx 4 everything ! ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 20:58 Message: Sounds good to me! ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2012-08-07 20:45 Message: I took a closer look at this, and the makepy code is checking for the NewEnum method, but it doesn't appear in the TypeInfo. I think the right thing to do would be to always try to Invoke DISPID_NEWENUM first, and fall back to iterating Items if that fails. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 20:21 Message: So it looks like we need to work out why _NewEnum isn't being used in that case, as Roger mentioned. DumpDispatch is just like regular Dispatch when EnsureDispatch hasn't been used. IOW, DumbDispatch will always ignore the magic done by EnsureDispatch. ---------------------------------------------------------------------- Comment By: franckgaga () Date: 2012-08-07 20:04 Message: Thx for fast answer ! you're both right, outlook is using a 1-base index. If i try this simple code : import win32com.client olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") namespace = olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : mapiContacts = namespace.GetDefaultFolder(10).Items print mapiContacts[0] # INDEX 0 CRASHES It crashes with the same error. But if i try with index 1, 2, 3 etc. it works ! My code works with win32com.client.dynamic.DumbDispatch. What's the cons of DumbDispatch ? ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 16:34 Message: oops - I wrote that before seeing Roger's reply... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 16:33 Message: FWIW, EnsureDispatch will generated code into the win32com\client\gen_py directory (or possibly in %temp%\gen_py) - removing that directory should avoid needing to reinstall pywin32 to reset the behaviour. As to the problem itself, can you check if "self.mapiContacts.Items(0)" throws an exception? I'm wondering if the code is looping, but isn't handling the exception to stop the looping correctly (ie, I'm wondering if the code is failing *after* it successfully enumerates the contacts or before). ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2012-08-07 12:10 Message: It appears outlook is using a 1-based index for the contact items. When using the generated wrapper classes, iteration is performed by calling for Items starting with 0, and throws the error you're seeing. The dynamic Dispatch is querying for an iterator using DISPID_NEWENUM, and the resulting enumerator works regardless of the indexing scheme. The makepy generated classes should probably use that same process. As a workaround, you can use win32com.client.dynamic.DumbDispatch to get the dynamic behaviour for just the mapiContacts object. You can remove the makepy support by simply clearing the \win32com\gen_py directory rather than reinstalling. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-08 14:01:00
|
Bugs item #3555112, was opened at 2012-08-07 07:19 Message generated for change (Comment added) made by You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: com Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: franckgaga () Assigned to: Nobody/Anonymous (nobody) Summary: EnsureDispatch error 2147352567 but not Dispatch Initial Comment: I've got a strange problem : I'e trying to export Outlook Contacts in a List of Dictionnary. My code works perfectly with win32com.client.Dispatch("Outlook.Application). But it returns 0 contacts with win32com.client.gencache.EnsureDispatch("Outlook.Application) that is supposed to be faster and "safer". Here's my code : class MapiImport(): def __init__(self): self.olApp = win32com.client.Dispatch("Outlook.Application") self.namespace = self.olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : self.mapiContacts = self.namespace.GetDefaultFolder(10).Items def getContacts(self, *fields): contacts = [] # Class == 40 is ContactItem # Class == 69 is DistListItem # Exclude ditribution list and others objects != ContactItem for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : if not fields : ctact = dict((x.Name,x.Value) for x in contact.ItemProperties) else : ctact = {} for field in fields : itemProp = contact.itemProperties[field] ctact[field] = itemProp.Value contacts.append(ctact) return contacts #====TEST SCRIPT==== myMAPI = MapiImport() fields = (u"LastName",u"FirstName",u"Companies", u"HomeTelephoneNumber",u"Home2TelephoneNumber", u"MobileTelephoneNumber", u"BusinessTelephoneNumber",u"Business2TelephoneNumber", u"Email1Address",u"Email2Address",u"Email3Address", u"HomeAddress",u"BusinessAddress", u"Birthday",u"Anniversary", u"Body") print(myMAPI.getContacts(*fields)) So when i replace : olApp = win32com.client.Dispatch("Outlook.Application") With : olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") It returns this errors : Traceback (most recent call last): File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 42, in <module> print(myMAPI.getContacts(*fields)) File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 19, in getContacts for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : File "D:\Documents and Settings\da7950\Mes documents\Python27\lib\site-packages\win32com\gen_py\00062FFF-0000-0000-C000-000000000046x0x9x2\_Items.py", line 122, in __getitem__ return self._get_good_object_(self._oleobj_.Invoke(*(81, LCID, 1, 1, item)), "Item") com_error: (-2147352567, "Une exception s'est produite.", (4096, u'Microsoft Office Outlook', u'Index de la matrice en dehors des limites.', None, 0, -2147352567), None) The message means "Matrix index out of bounds". The strangiest thing is that after I called EnsureDispatch, win32com.client.Dispatch doesn't works anymore. I have to uninstall pywin32 and reinstall it... I'm running with Python2.7.3 32-bit with Outlook 2003 32-bit Thanks ---------------------------------------------------------------------- Comment By: franckgaga () Date: 2012-08-08 07:01 Message: So it will be corrected in a future version ? As a workaround, i use : for i in range (1, len(self.mapiContacts)+1): contact = self.mapiContacts[i] Thx 4 everything ! ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 20:58 Message: Sounds good to me! ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2012-08-07 20:45 Message: I took a closer look at this, and the makepy code is checking for the NewEnum method, but it doesn't appear in the TypeInfo. I think the right thing to do would be to always try to Invoke DISPID_NEWENUM first, and fall back to iterating Items if that fails. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 20:21 Message: So it looks like we need to work out why _NewEnum isn't being used in that case, as Roger mentioned. DumpDispatch is just like regular Dispatch when EnsureDispatch hasn't been used. IOW, DumbDispatch will always ignore the magic done by EnsureDispatch. ---------------------------------------------------------------------- Comment By: franckgaga () Date: 2012-08-07 20:04 Message: Thx for fast answer ! you're both right, outlook is using a 1-base index. If i try this simple code : import win32com.client olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") namespace = olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : mapiContacts = namespace.GetDefaultFolder(10).Items print mapiContacts[0] # INDEX 0 CRASHES It crashes with the same error. But if i try with index 1, 2, 3 etc. it works ! My code works with win32com.client.dynamic.DumbDispatch. What's the cons of DumbDispatch ? ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 16:34 Message: oops - I wrote that before seeing Roger's reply... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 16:33 Message: FWIW, EnsureDispatch will generated code into the win32com\client\gen_py directory (or possibly in %temp%\gen_py) - removing that directory should avoid needing to reinstall pywin32 to reset the behaviour. As to the problem itself, can you check if "self.mapiContacts.Items(0)" throws an exception? I'm wondering if the code is looping, but isn't handling the exception to stop the looping correctly (ie, I'm wondering if the code is failing *after* it successfully enumerates the contacts or before). ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2012-08-07 12:10 Message: It appears outlook is using a 1-based index for the contact items. When using the generated wrapper classes, iteration is performed by calling for Items starting with 0, and throws the error you're seeing. The dynamic Dispatch is querying for an iterator using DISPID_NEWENUM, and the resulting enumerator works regardless of the indexing scheme. The makepy generated classes should probably use that same process. As a workaround, you can use win32com.client.dynamic.DumbDispatch to get the dynamic behaviour for just the mapiContacts object. You can remove the makepy support by simply clearing the \win32com\gen_py directory rather than reinstalling. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-08 03:58:20
|
Bugs item #3555112, was opened at 2012-08-07 07:19 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: com Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: franckgaga () Assigned to: Nobody/Anonymous (nobody) Summary: EnsureDispatch error 2147352567 but not Dispatch Initial Comment: I've got a strange problem : I'e trying to export Outlook Contacts in a List of Dictionnary. My code works perfectly with win32com.client.Dispatch("Outlook.Application). But it returns 0 contacts with win32com.client.gencache.EnsureDispatch("Outlook.Application) that is supposed to be faster and "safer". Here's my code : class MapiImport(): def __init__(self): self.olApp = win32com.client.Dispatch("Outlook.Application") self.namespace = self.olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : self.mapiContacts = self.namespace.GetDefaultFolder(10).Items def getContacts(self, *fields): contacts = [] # Class == 40 is ContactItem # Class == 69 is DistListItem # Exclude ditribution list and others objects != ContactItem for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : if not fields : ctact = dict((x.Name,x.Value) for x in contact.ItemProperties) else : ctact = {} for field in fields : itemProp = contact.itemProperties[field] ctact[field] = itemProp.Value contacts.append(ctact) return contacts #====TEST SCRIPT==== myMAPI = MapiImport() fields = (u"LastName",u"FirstName",u"Companies", u"HomeTelephoneNumber",u"Home2TelephoneNumber", u"MobileTelephoneNumber", u"BusinessTelephoneNumber",u"Business2TelephoneNumber", u"Email1Address",u"Email2Address",u"Email3Address", u"HomeAddress",u"BusinessAddress", u"Birthday",u"Anniversary", u"Body") print(myMAPI.getContacts(*fields)) So when i replace : olApp = win32com.client.Dispatch("Outlook.Application") With : olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") It returns this errors : Traceback (most recent call last): File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 42, in <module> print(myMAPI.getContacts(*fields)) File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 19, in getContacts for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : File "D:\Documents and Settings\da7950\Mes documents\Python27\lib\site-packages\win32com\gen_py\00062FFF-0000-0000-C000-000000000046x0x9x2\_Items.py", line 122, in __getitem__ return self._get_good_object_(self._oleobj_.Invoke(*(81, LCID, 1, 1, item)), "Item") com_error: (-2147352567, "Une exception s'est produite.", (4096, u'Microsoft Office Outlook', u'Index de la matrice en dehors des limites.', None, 0, -2147352567), None) The message means "Matrix index out of bounds". The strangiest thing is that after I called EnsureDispatch, win32com.client.Dispatch doesn't works anymore. I have to uninstall pywin32 and reinstall it... I'm running with Python2.7.3 32-bit with Outlook 2003 32-bit Thanks ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2012-08-07 20:58 Message: Sounds good to me! ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2012-08-07 20:45 Message: I took a closer look at this, and the makepy code is checking for the NewEnum method, but it doesn't appear in the TypeInfo. I think the right thing to do would be to always try to Invoke DISPID_NEWENUM first, and fall back to iterating Items if that fails. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 20:21 Message: So it looks like we need to work out why _NewEnum isn't being used in that case, as Roger mentioned. DumpDispatch is just like regular Dispatch when EnsureDispatch hasn't been used. IOW, DumbDispatch will always ignore the magic done by EnsureDispatch. ---------------------------------------------------------------------- Comment By: franckgaga () Date: 2012-08-07 20:04 Message: Thx for fast answer ! you're both right, outlook is using a 1-base index. If i try this simple code : import win32com.client olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") namespace = olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : mapiContacts = namespace.GetDefaultFolder(10).Items print mapiContacts[0] # INDEX 0 CRASHES It crashes with the same error. But if i try with index 1, 2, 3 etc. it works ! My code works with win32com.client.dynamic.DumbDispatch. What's the cons of DumbDispatch ? ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 16:34 Message: oops - I wrote that before seeing Roger's reply... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 16:33 Message: FWIW, EnsureDispatch will generated code into the win32com\client\gen_py directory (or possibly in %temp%\gen_py) - removing that directory should avoid needing to reinstall pywin32 to reset the behaviour. As to the problem itself, can you check if "self.mapiContacts.Items(0)" throws an exception? I'm wondering if the code is looping, but isn't handling the exception to stop the looping correctly (ie, I'm wondering if the code is failing *after* it successfully enumerates the contacts or before). ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2012-08-07 12:10 Message: It appears outlook is using a 1-based index for the contact items. When using the generated wrapper classes, iteration is performed by calling for Items starting with 0, and throws the error you're seeing. The dynamic Dispatch is querying for an iterator using DISPID_NEWENUM, and the resulting enumerator works regardless of the indexing scheme. The makepy generated classes should probably use that same process. As a workaround, you can use win32com.client.dynamic.DumbDispatch to get the dynamic behaviour for just the mapiContacts object. You can remove the makepy support by simply clearing the \win32com\gen_py directory rather than reinstalling. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-08 03:45:21
|
Bugs item #3555112, was opened at 2012-08-07 07:19 Message generated for change (Comment added) made by rupole You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: com Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: franckgaga () Assigned to: Nobody/Anonymous (nobody) Summary: EnsureDispatch error 2147352567 but not Dispatch Initial Comment: I've got a strange problem : I'e trying to export Outlook Contacts in a List of Dictionnary. My code works perfectly with win32com.client.Dispatch("Outlook.Application). But it returns 0 contacts with win32com.client.gencache.EnsureDispatch("Outlook.Application) that is supposed to be faster and "safer". Here's my code : class MapiImport(): def __init__(self): self.olApp = win32com.client.Dispatch("Outlook.Application") self.namespace = self.olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : self.mapiContacts = self.namespace.GetDefaultFolder(10).Items def getContacts(self, *fields): contacts = [] # Class == 40 is ContactItem # Class == 69 is DistListItem # Exclude ditribution list and others objects != ContactItem for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : if not fields : ctact = dict((x.Name,x.Value) for x in contact.ItemProperties) else : ctact = {} for field in fields : itemProp = contact.itemProperties[field] ctact[field] = itemProp.Value contacts.append(ctact) return contacts #====TEST SCRIPT==== myMAPI = MapiImport() fields = (u"LastName",u"FirstName",u"Companies", u"HomeTelephoneNumber",u"Home2TelephoneNumber", u"MobileTelephoneNumber", u"BusinessTelephoneNumber",u"Business2TelephoneNumber", u"Email1Address",u"Email2Address",u"Email3Address", u"HomeAddress",u"BusinessAddress", u"Birthday",u"Anniversary", u"Body") print(myMAPI.getContacts(*fields)) So when i replace : olApp = win32com.client.Dispatch("Outlook.Application") With : olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") It returns this errors : Traceback (most recent call last): File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 42, in <module> print(myMAPI.getContacts(*fields)) File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 19, in getContacts for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : File "D:\Documents and Settings\da7950\Mes documents\Python27\lib\site-packages\win32com\gen_py\00062FFF-0000-0000-C000-000000000046x0x9x2\_Items.py", line 122, in __getitem__ return self._get_good_object_(self._oleobj_.Invoke(*(81, LCID, 1, 1, item)), "Item") com_error: (-2147352567, "Une exception s'est produite.", (4096, u'Microsoft Office Outlook', u'Index de la matrice en dehors des limites.', None, 0, -2147352567), None) The message means "Matrix index out of bounds". The strangiest thing is that after I called EnsureDispatch, win32com.client.Dispatch doesn't works anymore. I have to uninstall pywin32 and reinstall it... I'm running with Python2.7.3 32-bit with Outlook 2003 32-bit Thanks ---------------------------------------------------------------------- >Comment By: Roger Upole (rupole) Date: 2012-08-07 20:45 Message: I took a closer look at this, and the makepy code is checking for the NewEnum method, but it doesn't appear in the TypeInfo. I think the right thing to do would be to always try to Invoke DISPID_NEWENUM first, and fall back to iterating Items if that fails. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 20:21 Message: So it looks like we need to work out why _NewEnum isn't being used in that case, as Roger mentioned. DumpDispatch is just like regular Dispatch when EnsureDispatch hasn't been used. IOW, DumbDispatch will always ignore the magic done by EnsureDispatch. ---------------------------------------------------------------------- Comment By: franckgaga () Date: 2012-08-07 20:04 Message: Thx for fast answer ! you're both right, outlook is using a 1-base index. If i try this simple code : import win32com.client olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") namespace = olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : mapiContacts = namespace.GetDefaultFolder(10).Items print mapiContacts[0] # INDEX 0 CRASHES It crashes with the same error. But if i try with index 1, 2, 3 etc. it works ! My code works with win32com.client.dynamic.DumbDispatch. What's the cons of DumbDispatch ? ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 16:34 Message: oops - I wrote that before seeing Roger's reply... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 16:33 Message: FWIW, EnsureDispatch will generated code into the win32com\client\gen_py directory (or possibly in %temp%\gen_py) - removing that directory should avoid needing to reinstall pywin32 to reset the behaviour. As to the problem itself, can you check if "self.mapiContacts.Items(0)" throws an exception? I'm wondering if the code is looping, but isn't handling the exception to stop the looping correctly (ie, I'm wondering if the code is failing *after* it successfully enumerates the contacts or before). ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2012-08-07 12:10 Message: It appears outlook is using a 1-based index for the contact items. When using the generated wrapper classes, iteration is performed by calling for Items starting with 0, and throws the error you're seeing. The dynamic Dispatch is querying for an iterator using DISPID_NEWENUM, and the resulting enumerator works regardless of the indexing scheme. The makepy generated classes should probably use that same process. As a workaround, you can use win32com.client.dynamic.DumbDispatch to get the dynamic behaviour for just the mapiContacts object. You can remove the makepy support by simply clearing the \win32com\gen_py directory rather than reinstalling. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-08 03:21:39
|
Bugs item #3555112, was opened at 2012-08-07 07:19 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: com Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: franckgaga () Assigned to: Nobody/Anonymous (nobody) Summary: EnsureDispatch error 2147352567 but not Dispatch Initial Comment: I've got a strange problem : I'e trying to export Outlook Contacts in a List of Dictionnary. My code works perfectly with win32com.client.Dispatch("Outlook.Application). But it returns 0 contacts with win32com.client.gencache.EnsureDispatch("Outlook.Application) that is supposed to be faster and "safer". Here's my code : class MapiImport(): def __init__(self): self.olApp = win32com.client.Dispatch("Outlook.Application") self.namespace = self.olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : self.mapiContacts = self.namespace.GetDefaultFolder(10).Items def getContacts(self, *fields): contacts = [] # Class == 40 is ContactItem # Class == 69 is DistListItem # Exclude ditribution list and others objects != ContactItem for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : if not fields : ctact = dict((x.Name,x.Value) for x in contact.ItemProperties) else : ctact = {} for field in fields : itemProp = contact.itemProperties[field] ctact[field] = itemProp.Value contacts.append(ctact) return contacts #====TEST SCRIPT==== myMAPI = MapiImport() fields = (u"LastName",u"FirstName",u"Companies", u"HomeTelephoneNumber",u"Home2TelephoneNumber", u"MobileTelephoneNumber", u"BusinessTelephoneNumber",u"Business2TelephoneNumber", u"Email1Address",u"Email2Address",u"Email3Address", u"HomeAddress",u"BusinessAddress", u"Birthday",u"Anniversary", u"Body") print(myMAPI.getContacts(*fields)) So when i replace : olApp = win32com.client.Dispatch("Outlook.Application") With : olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") It returns this errors : Traceback (most recent call last): File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 42, in <module> print(myMAPI.getContacts(*fields)) File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 19, in getContacts for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : File "D:\Documents and Settings\da7950\Mes documents\Python27\lib\site-packages\win32com\gen_py\00062FFF-0000-0000-C000-000000000046x0x9x2\_Items.py", line 122, in __getitem__ return self._get_good_object_(self._oleobj_.Invoke(*(81, LCID, 1, 1, item)), "Item") com_error: (-2147352567, "Une exception s'est produite.", (4096, u'Microsoft Office Outlook', u'Index de la matrice en dehors des limites.', None, 0, -2147352567), None) The message means "Matrix index out of bounds". The strangiest thing is that after I called EnsureDispatch, win32com.client.Dispatch doesn't works anymore. I have to uninstall pywin32 and reinstall it... I'm running with Python2.7.3 32-bit with Outlook 2003 32-bit Thanks ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2012-08-07 20:21 Message: So it looks like we need to work out why _NewEnum isn't being used in that case, as Roger mentioned. DumpDispatch is just like regular Dispatch when EnsureDispatch hasn't been used. IOW, DumbDispatch will always ignore the magic done by EnsureDispatch. ---------------------------------------------------------------------- Comment By: franckgaga () Date: 2012-08-07 20:04 Message: Thx for fast answer ! you're both right, outlook is using a 1-base index. If i try this simple code : import win32com.client olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") namespace = olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : mapiContacts = namespace.GetDefaultFolder(10).Items print mapiContacts[0] # INDEX 0 CRASHES It crashes with the same error. But if i try with index 1, 2, 3 etc. it works ! My code works with win32com.client.dynamic.DumbDispatch. What's the cons of DumbDispatch ? ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 16:34 Message: oops - I wrote that before seeing Roger's reply... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 16:33 Message: FWIW, EnsureDispatch will generated code into the win32com\client\gen_py directory (or possibly in %temp%\gen_py) - removing that directory should avoid needing to reinstall pywin32 to reset the behaviour. As to the problem itself, can you check if "self.mapiContacts.Items(0)" throws an exception? I'm wondering if the code is looping, but isn't handling the exception to stop the looping correctly (ie, I'm wondering if the code is failing *after* it successfully enumerates the contacts or before). ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2012-08-07 12:10 Message: It appears outlook is using a 1-based index for the contact items. When using the generated wrapper classes, iteration is performed by calling for Items starting with 0, and throws the error you're seeing. The dynamic Dispatch is querying for an iterator using DISPID_NEWENUM, and the resulting enumerator works regardless of the indexing scheme. The makepy generated classes should probably use that same process. As a workaround, you can use win32com.client.dynamic.DumbDispatch to get the dynamic behaviour for just the mapiContacts object. You can remove the makepy support by simply clearing the \win32com\gen_py directory rather than reinstalling. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-08 03:04:51
|
Bugs item #3555112, was opened at 2012-08-07 07:19 Message generated for change (Comment added) made by You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: com Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: franckgaga () Assigned to: Nobody/Anonymous (nobody) Summary: EnsureDispatch error 2147352567 but not Dispatch Initial Comment: I've got a strange problem : I'e trying to export Outlook Contacts in a List of Dictionnary. My code works perfectly with win32com.client.Dispatch("Outlook.Application). But it returns 0 contacts with win32com.client.gencache.EnsureDispatch("Outlook.Application) that is supposed to be faster and "safer". Here's my code : class MapiImport(): def __init__(self): self.olApp = win32com.client.Dispatch("Outlook.Application") self.namespace = self.olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : self.mapiContacts = self.namespace.GetDefaultFolder(10).Items def getContacts(self, *fields): contacts = [] # Class == 40 is ContactItem # Class == 69 is DistListItem # Exclude ditribution list and others objects != ContactItem for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : if not fields : ctact = dict((x.Name,x.Value) for x in contact.ItemProperties) else : ctact = {} for field in fields : itemProp = contact.itemProperties[field] ctact[field] = itemProp.Value contacts.append(ctact) return contacts #====TEST SCRIPT==== myMAPI = MapiImport() fields = (u"LastName",u"FirstName",u"Companies", u"HomeTelephoneNumber",u"Home2TelephoneNumber", u"MobileTelephoneNumber", u"BusinessTelephoneNumber",u"Business2TelephoneNumber", u"Email1Address",u"Email2Address",u"Email3Address", u"HomeAddress",u"BusinessAddress", u"Birthday",u"Anniversary", u"Body") print(myMAPI.getContacts(*fields)) So when i replace : olApp = win32com.client.Dispatch("Outlook.Application") With : olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") It returns this errors : Traceback (most recent call last): File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 42, in <module> print(myMAPI.getContacts(*fields)) File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 19, in getContacts for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : File "D:\Documents and Settings\da7950\Mes documents\Python27\lib\site-packages\win32com\gen_py\00062FFF-0000-0000-C000-000000000046x0x9x2\_Items.py", line 122, in __getitem__ return self._get_good_object_(self._oleobj_.Invoke(*(81, LCID, 1, 1, item)), "Item") com_error: (-2147352567, "Une exception s'est produite.", (4096, u'Microsoft Office Outlook', u'Index de la matrice en dehors des limites.', None, 0, -2147352567), None) The message means "Matrix index out of bounds". The strangiest thing is that after I called EnsureDispatch, win32com.client.Dispatch doesn't works anymore. I have to uninstall pywin32 and reinstall it... I'm running with Python2.7.3 32-bit with Outlook 2003 32-bit Thanks ---------------------------------------------------------------------- Comment By: franckgaga () Date: 2012-08-07 20:04 Message: Thx for fast answer ! you're both right, outlook is using a 1-base index. If i try this simple code : import win32com.client olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") namespace = olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : mapiContacts = namespace.GetDefaultFolder(10).Items print mapiContacts[0] # INDEX 0 CRASHES It crashes with the same error. But if i try with index 1, 2, 3 etc. it works ! My code works with win32com.client.dynamic.DumbDispatch. What's the cons of DumbDispatch ? ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 16:34 Message: oops - I wrote that before seeing Roger's reply... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 16:33 Message: FWIW, EnsureDispatch will generated code into the win32com\client\gen_py directory (or possibly in %temp%\gen_py) - removing that directory should avoid needing to reinstall pywin32 to reset the behaviour. As to the problem itself, can you check if "self.mapiContacts.Items(0)" throws an exception? I'm wondering if the code is looping, but isn't handling the exception to stop the looping correctly (ie, I'm wondering if the code is failing *after* it successfully enumerates the contacts or before). ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2012-08-07 12:10 Message: It appears outlook is using a 1-based index for the contact items. When using the generated wrapper classes, iteration is performed by calling for Items starting with 0, and throws the error you're seeing. The dynamic Dispatch is querying for an iterator using DISPID_NEWENUM, and the resulting enumerator works regardless of the indexing scheme. The makepy generated classes should probably use that same process. As a workaround, you can use win32com.client.dynamic.DumbDispatch to get the dynamic behaviour for just the mapiContacts object. You can remove the makepy support by simply clearing the \win32com\gen_py directory rather than reinstalling. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-07 23:34:20
|
Bugs item #3555112, was opened at 2012-08-07 07:19 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: com Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: franckgaga () Assigned to: Nobody/Anonymous (nobody) Summary: EnsureDispatch error 2147352567 but not Dispatch Initial Comment: I've got a strange problem : I'e trying to export Outlook Contacts in a List of Dictionnary. My code works perfectly with win32com.client.Dispatch("Outlook.Application). But it returns 0 contacts with win32com.client.gencache.EnsureDispatch("Outlook.Application) that is supposed to be faster and "safer". Here's my code : class MapiImport(): def __init__(self): self.olApp = win32com.client.Dispatch("Outlook.Application") self.namespace = self.olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : self.mapiContacts = self.namespace.GetDefaultFolder(10).Items def getContacts(self, *fields): contacts = [] # Class == 40 is ContactItem # Class == 69 is DistListItem # Exclude ditribution list and others objects != ContactItem for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : if not fields : ctact = dict((x.Name,x.Value) for x in contact.ItemProperties) else : ctact = {} for field in fields : itemProp = contact.itemProperties[field] ctact[field] = itemProp.Value contacts.append(ctact) return contacts #====TEST SCRIPT==== myMAPI = MapiImport() fields = (u"LastName",u"FirstName",u"Companies", u"HomeTelephoneNumber",u"Home2TelephoneNumber", u"MobileTelephoneNumber", u"BusinessTelephoneNumber",u"Business2TelephoneNumber", u"Email1Address",u"Email2Address",u"Email3Address", u"HomeAddress",u"BusinessAddress", u"Birthday",u"Anniversary", u"Body") print(myMAPI.getContacts(*fields)) So when i replace : olApp = win32com.client.Dispatch("Outlook.Application") With : olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") It returns this errors : Traceback (most recent call last): File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 42, in <module> print(myMAPI.getContacts(*fields)) File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 19, in getContacts for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : File "D:\Documents and Settings\da7950\Mes documents\Python27\lib\site-packages\win32com\gen_py\00062FFF-0000-0000-C000-000000000046x0x9x2\_Items.py", line 122, in __getitem__ return self._get_good_object_(self._oleobj_.Invoke(*(81, LCID, 1, 1, item)), "Item") com_error: (-2147352567, "Une exception s'est produite.", (4096, u'Microsoft Office Outlook', u'Index de la matrice en dehors des limites.', None, 0, -2147352567), None) The message means "Matrix index out of bounds". The strangiest thing is that after I called EnsureDispatch, win32com.client.Dispatch doesn't works anymore. I have to uninstall pywin32 and reinstall it... I'm running with Python2.7.3 32-bit with Outlook 2003 32-bit Thanks ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2012-08-07 16:34 Message: oops - I wrote that before seeing Roger's reply... ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2012-08-07 16:33 Message: FWIW, EnsureDispatch will generated code into the win32com\client\gen_py directory (or possibly in %temp%\gen_py) - removing that directory should avoid needing to reinstall pywin32 to reset the behaviour. As to the problem itself, can you check if "self.mapiContacts.Items(0)" throws an exception? I'm wondering if the code is looping, but isn't handling the exception to stop the looping correctly (ie, I'm wondering if the code is failing *after* it successfully enumerates the contacts or before). ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2012-08-07 12:10 Message: It appears outlook is using a 1-based index for the contact items. When using the generated wrapper classes, iteration is performed by calling for Items starting with 0, and throws the error you're seeing. The dynamic Dispatch is querying for an iterator using DISPID_NEWENUM, and the resulting enumerator works regardless of the indexing scheme. The makepy generated classes should probably use that same process. As a workaround, you can use win32com.client.dynamic.DumbDispatch to get the dynamic behaviour for just the mapiContacts object. You can remove the makepy support by simply clearing the \win32com\gen_py directory rather than reinstalling. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-07 23:33:03
|
Bugs item #3555112, was opened at 2012-08-07 07:19 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: com Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: franckgaga () Assigned to: Nobody/Anonymous (nobody) Summary: EnsureDispatch error 2147352567 but not Dispatch Initial Comment: I've got a strange problem : I'e trying to export Outlook Contacts in a List of Dictionnary. My code works perfectly with win32com.client.Dispatch("Outlook.Application). But it returns 0 contacts with win32com.client.gencache.EnsureDispatch("Outlook.Application) that is supposed to be faster and "safer". Here's my code : class MapiImport(): def __init__(self): self.olApp = win32com.client.Dispatch("Outlook.Application") self.namespace = self.olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : self.mapiContacts = self.namespace.GetDefaultFolder(10).Items def getContacts(self, *fields): contacts = [] # Class == 40 is ContactItem # Class == 69 is DistListItem # Exclude ditribution list and others objects != ContactItem for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : if not fields : ctact = dict((x.Name,x.Value) for x in contact.ItemProperties) else : ctact = {} for field in fields : itemProp = contact.itemProperties[field] ctact[field] = itemProp.Value contacts.append(ctact) return contacts #====TEST SCRIPT==== myMAPI = MapiImport() fields = (u"LastName",u"FirstName",u"Companies", u"HomeTelephoneNumber",u"Home2TelephoneNumber", u"MobileTelephoneNumber", u"BusinessTelephoneNumber",u"Business2TelephoneNumber", u"Email1Address",u"Email2Address",u"Email3Address", u"HomeAddress",u"BusinessAddress", u"Birthday",u"Anniversary", u"Body") print(myMAPI.getContacts(*fields)) So when i replace : olApp = win32com.client.Dispatch("Outlook.Application") With : olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") It returns this errors : Traceback (most recent call last): File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 42, in <module> print(myMAPI.getContacts(*fields)) File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 19, in getContacts for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : File "D:\Documents and Settings\da7950\Mes documents\Python27\lib\site-packages\win32com\gen_py\00062FFF-0000-0000-C000-000000000046x0x9x2\_Items.py", line 122, in __getitem__ return self._get_good_object_(self._oleobj_.Invoke(*(81, LCID, 1, 1, item)), "Item") com_error: (-2147352567, "Une exception s'est produite.", (4096, u'Microsoft Office Outlook', u'Index de la matrice en dehors des limites.', None, 0, -2147352567), None) The message means "Matrix index out of bounds". The strangiest thing is that after I called EnsureDispatch, win32com.client.Dispatch doesn't works anymore. I have to uninstall pywin32 and reinstall it... I'm running with Python2.7.3 32-bit with Outlook 2003 32-bit Thanks ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2012-08-07 16:33 Message: FWIW, EnsureDispatch will generated code into the win32com\client\gen_py directory (or possibly in %temp%\gen_py) - removing that directory should avoid needing to reinstall pywin32 to reset the behaviour. As to the problem itself, can you check if "self.mapiContacts.Items(0)" throws an exception? I'm wondering if the code is looping, but isn't handling the exception to stop the looping correctly (ie, I'm wondering if the code is failing *after* it successfully enumerates the contacts or before). ---------------------------------------------------------------------- Comment By: Roger Upole (rupole) Date: 2012-08-07 12:10 Message: It appears outlook is using a 1-based index for the contact items. When using the generated wrapper classes, iteration is performed by calling for Items starting with 0, and throws the error you're seeing. The dynamic Dispatch is querying for an iterator using DISPID_NEWENUM, and the resulting enumerator works regardless of the indexing scheme. The makepy generated classes should probably use that same process. As a workaround, you can use win32com.client.dynamic.DumbDispatch to get the dynamic behaviour for just the mapiContacts object. You can remove the makepy support by simply clearing the \win32com\gen_py directory rather than reinstalling. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-07 20:18:30
|
Bugs item #3555177, was opened at 2012-08-07 13:18 Message generated for change (Tracker Item Submitted) made by rupole You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555177&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: com Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Roger Upole (rupole) Assigned to: Nobody/Anonymous (nobody) Summary: makepy can generate invalid syntax Initial Comment: From this question on StackOverflow: http://stackoverflow.com/questions/11630973/makepy-error-xceedzip-dll If a module contains constants whose repr() can't be used as a constructor, it will get written to the generated file anyway, causing a SyntaxError when it's imported. In this case it was a time, generating the invalid code xcdMaximumDate =<PyTime:12/31/9999 12:00:00 AM> # from enum XceedConstants ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555177&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-07 19:10:44
|
Bugs item #3555112, was opened at 2012-08-07 07:19 Message generated for change (Comment added) made by rupole You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: com Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: franckgaga () Assigned to: Nobody/Anonymous (nobody) Summary: EnsureDispatch error 2147352567 but not Dispatch Initial Comment: I've got a strange problem : I'e trying to export Outlook Contacts in a List of Dictionnary. My code works perfectly with win32com.client.Dispatch("Outlook.Application). But it returns 0 contacts with win32com.client.gencache.EnsureDispatch("Outlook.Application) that is supposed to be faster and "safer". Here's my code : class MapiImport(): def __init__(self): self.olApp = win32com.client.Dispatch("Outlook.Application") self.namespace = self.olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : self.mapiContacts = self.namespace.GetDefaultFolder(10).Items def getContacts(self, *fields): contacts = [] # Class == 40 is ContactItem # Class == 69 is DistListItem # Exclude ditribution list and others objects != ContactItem for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : if not fields : ctact = dict((x.Name,x.Value) for x in contact.ItemProperties) else : ctact = {} for field in fields : itemProp = contact.itemProperties[field] ctact[field] = itemProp.Value contacts.append(ctact) return contacts #====TEST SCRIPT==== myMAPI = MapiImport() fields = (u"LastName",u"FirstName",u"Companies", u"HomeTelephoneNumber",u"Home2TelephoneNumber", u"MobileTelephoneNumber", u"BusinessTelephoneNumber",u"Business2TelephoneNumber", u"Email1Address",u"Email2Address",u"Email3Address", u"HomeAddress",u"BusinessAddress", u"Birthday",u"Anniversary", u"Body") print(myMAPI.getContacts(*fields)) So when i replace : olApp = win32com.client.Dispatch("Outlook.Application") With : olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") It returns this errors : Traceback (most recent call last): File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 42, in <module> print(myMAPI.getContacts(*fields)) File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 19, in getContacts for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : File "D:\Documents and Settings\da7950\Mes documents\Python27\lib\site-packages\win32com\gen_py\00062FFF-0000-0000-C000-000000000046x0x9x2\_Items.py", line 122, in __getitem__ return self._get_good_object_(self._oleobj_.Invoke(*(81, LCID, 1, 1, item)), "Item") com_error: (-2147352567, "Une exception s'est produite.", (4096, u'Microsoft Office Outlook', u'Index de la matrice en dehors des limites.', None, 0, -2147352567), None) The message means "Matrix index out of bounds". The strangiest thing is that after I called EnsureDispatch, win32com.client.Dispatch doesn't works anymore. I have to uninstall pywin32 and reinstall it... I'm running with Python2.7.3 32-bit with Outlook 2003 32-bit Thanks ---------------------------------------------------------------------- >Comment By: Roger Upole (rupole) Date: 2012-08-07 12:10 Message: It appears outlook is using a 1-based index for the contact items. When using the generated wrapper classes, iteration is performed by calling for Items starting with 0, and throws the error you're seeing. The dynamic Dispatch is querying for an iterator using DISPID_NEWENUM, and the resulting enumerator works regardless of the indexing scheme. The makepy generated classes should probably use that same process. As a workaround, you can use win32com.client.dynamic.DumbDispatch to get the dynamic behaviour for just the mapiContacts object. You can remove the makepy support by simply clearing the \win32com\gen_py directory rather than reinstalling. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 |
From: SourceForge.net <no...@so...> - 2012-08-07 14:19:03
|
Bugs item #3555112, was opened at 2012-08-07 07:19 Message generated for change (Tracker Item Submitted) made by You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: com Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: franckgaga () Assigned to: Nobody/Anonymous (nobody) Summary: EnsureDispatch error 2147352567 but not Dispatch Initial Comment: I've got a strange problem : I'e trying to export Outlook Contacts in a List of Dictionnary. My code works perfectly with win32com.client.Dispatch("Outlook.Application). But it returns 0 contacts with win32com.client.gencache.EnsureDispatch("Outlook.Application) that is supposed to be faster and "safer". Here's my code : class MapiImport(): def __init__(self): self.olApp = win32com.client.Dispatch("Outlook.Application") self.namespace = self.olApp.GetNamespace(u"MAPI") # olFolderContacts = 10 : self.mapiContacts = self.namespace.GetDefaultFolder(10).Items def getContacts(self, *fields): contacts = [] # Class == 40 is ContactItem # Class == 69 is DistListItem # Exclude ditribution list and others objects != ContactItem for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : if not fields : ctact = dict((x.Name,x.Value) for x in contact.ItemProperties) else : ctact = {} for field in fields : itemProp = contact.itemProperties[field] ctact[field] = itemProp.Value contacts.append(ctact) return contacts #====TEST SCRIPT==== myMAPI = MapiImport() fields = (u"LastName",u"FirstName",u"Companies", u"HomeTelephoneNumber",u"Home2TelephoneNumber", u"MobileTelephoneNumber", u"BusinessTelephoneNumber",u"Business2TelephoneNumber", u"Email1Address",u"Email2Address",u"Email3Address", u"HomeAddress",u"BusinessAddress", u"Birthday",u"Anniversary", u"Body") print(myMAPI.getContacts(*fields)) So when i replace : olApp = win32com.client.Dispatch("Outlook.Application") With : olApp = win32com.client.gencache.EnsureDispatch("Outlook.Application") It returns this errors : Traceback (most recent call last): File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 42, in <module> print(myMAPI.getContacts(*fields)) File "D:\Documents and Settings\da7950\Mes documents\Dropbox\cheetahImporter\mapiImport.py", line 19, in getContacts for contact in filter(lambda x: x.Class == 40,self.mapiContacts) : File "D:\Documents and Settings\da7950\Mes documents\Python27\lib\site-packages\win32com\gen_py\00062FFF-0000-0000-C000-000000000046x0x9x2\_Items.py", line 122, in __getitem__ return self._get_good_object_(self._oleobj_.Invoke(*(81, LCID, 1, 1, item)), "Item") com_error: (-2147352567, "Une exception s'est produite.", (4096, u'Microsoft Office Outlook', u'Index de la matrice en dehors des limites.', None, 0, -2147352567), None) The message means "Matrix index out of bounds". The strangiest thing is that after I called EnsureDispatch, win32com.client.Dispatch doesn't works anymore. I have to uninstall pywin32 and reinstall it... I'm running with Python2.7.3 32-bit with Outlook 2003 32-bit Thanks ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3555112&group_id=78018 |