Hi,
On 11/13/07, Thomas Heller <[EMAIL PROTECTED]> wrote:
> Can you please try and remove all files from the comtypes\gen directory,
> and then rerun your script?
   Note that script runs without problem. I get the exception only if
I set breakpoint in either PyScriptor or PythonWin.
    I uninstalled 0.4 & installed 0.3.3 (without deleting /gen) and
everything worked fine. So I downloaded the zip distributions of 0.4 &
0.3.3 to try out using .pth method. (Apparently comtypes-0.3.3.zip
does not contain 'partial.py' and I had to copy it from exe). So
starting at clean install, I got no problem for 0.3.3 but 0.4 failed
with following exception. The code I tried was:

import comtypes.client
comtypes.client.GetModule(("{00020905-0000-0000-C000-000000000046}",
8, 0, 1033))
# set breakpoint on next line in ide
wa = comtypes.client.CreateObject('Word.Application')
wa.Quit()

Console output:

# Generating comtypes.gen._00020905_0000_0000_C000_000000000046_0_8_2
# Generating comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0
Traceback (most recent call last):
  File "<string>", line 124, in run
  File "C:\Python25\Lib\bdb.py", line 366, in run
    exec cmd in globals, locals
  File "C:\data\com_test.py", line 2, in <module>
    comtypes.client.GetModule(("{00020905-0000-0000-C000-000000000046}",
8, 0, 1033))
  File "C:\data\comtypes-0.4.0\comtypes\client\_generate.py", line
100, in GetModule
    is_current, mod = _CreateWrapper(tlib, pathname)
  File "C:\data\comtypes-0.4.0\comtypes\client\_generate.py", line
206, in _CreateWrapper
    generate_module(tlib, ofi, pathname)
  File "C:\data\comtypes-0.4.0\comtypes\tools\tlbparser.py", line 704,
in generate_module
    gen.generate_code(items.values(), filename=pathname)
  File "C:\data\comtypes-0.4.0\comtypes\tools\codegenerator.py", line
239, in generate_code
    self.generate_all(sorted(items, self.cmpitems))
  File "C:\data\comtypes-0.4.0\comtypes\tools\codegenerator.py", line
181, in generate_all
    self.generate(item)
  File "C:\data\comtypes-0.4.0\comtypes\tools\codegenerator.py", line
177, in generate
    mth(item)
  File "C:\data\comtypes-0.4.0\comtypes\tools\codegenerator.py", line
671, in ComInterface
    self.generate(itf.get_head())
  File "C:\data\comtypes-0.4.0\comtypes\tools\codegenerator.py", line
177, in generate
    mth(item)
  File "C:\data\comtypes-0.4.0\comtypes\tools\codegenerator.py", line
692, in ComInterfaceHead
    self.generate(base.get_head())
  File "C:\data\comtypes-0.4.0\comtypes\tools\codegenerator.py", line
177, in generate
    mth(item)
  File "C:\data\comtypes-0.4.0\comtypes\tools\codegenerator.py", line
609, in External
    comtypes.client.GetModule(ext.tlib)
  File "C:\data\comtypes-0.4.0\comtypes\client\_generate.py", line
100, in GetModule
    is_current, mod = _CreateWrapper(tlib, pathname)
  File "C:\data\comtypes-0.4.0\comtypes\client\_generate.py", line
218, in _CreateWrapper
    mod = _my_import(fullname)
  File "C:\data\comtypes-0.4.0\comtypes\client\_generate.py", line 14,
in _my_import
    return __import__(fullname, globals(), locals(), ['DUMMY'])
  File 
"C:\data\comtypes-0.4.0\comtypes\gen\_00020430_0000_0000_C000_000000000046_0_2_0.py",
line 220, in <module>
    ( [], c_void_p, 'prcWBounds' )),
  File "C:\data\comtypes-0.4.0\comtypes\__init__.py", line 239, in __setattr__
    self._make_specials()
  File "C:\data\comtypes-0.4.0\comtypes\__init__.py", line 253, in
_make_specials
    class _(partial.partial, self):
  File "C:\data\comtypes-0.4.0\comtypes\partial.py", line 41, in __new__
    raise TypeError, "%s already has %s" % (repr(base), k)
TypeError: <class
'comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0.Picture'>
already has has_name

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to