[python-win32] Prob w/ win32com under XP (very weird) - addenda

Kevin Horn funsize at mindspring.com
Wed Jun 4 11:32:56 EDT 2003


I am experiencing the same problem with my setup.  It started when I upgraded to Python 2.2.2, and win32all-152

I am running on Win2K, though not XP.

I have experienced the following symptoms:
"from win32com.client import Dispatch" fails in command line interactive interpreter
"from win32com.client import Dispatch" fails in scripts run from command line
doing "import win32com.client" before "from..." seems to help MOST of the time (not always?!?!)
"from win32com.client import Dispatch" seems to work fine from Pytonwin interactive interpreter window

What's going on?
ACK!

Regards,
Funsize


[Guy U. wrote:]

A little more fiddling reveals that:

<script snippet>
import win32com.client

pycomhack = win32com.client.Dispatch("myCOMthingy.myCOMthingy")

pycomhack.SetSession("A",4)
</script snippet>

works just fine as a script.  So the core problem here is for some
reason
it doesn't like:

  from win32com.client import Dispatch

in a script anymore.


[====start original message====]

(a little longish, sorry)

I have COM based test harness for a component I am responsible that I
script 
with python, hence win32com.

I recently install WinXP Pro and reinstalled Python 2.2.2 (along with
win32com).  
None of my scripts will work now (but that isn't the weird part...)

All my scripts start with the following:

<script snippet>
  from win32com.client import Dispatch

  pycomhack = Dispatch("myCOMthingy.myCOMthingy")
  :
</script snippet>


Now when I try to run them, I get an error (from the annoying little
'send us the error' dialog)

AppName: python.exe  AppVer: 0.0.0.0  ModName: python22.dll
ModVer: 2.2.2150.1011  Offset: 00039e79


So as a sanity check I went to the command line and into interactive
mode and did:

>> from win32com.client import Dispatch

I get the same crash.  Damn.  OK lets try

>> import win32com.client

Hey that seems OK, lets try again just for laughs:

>> from win32com.client import Dispatch

It works this time! So this sequence works in interactive mode.

>> import win32com.client
>> from win32com.client import Dispatch
>> pycomhack = Dispatch("myCOMthingy.myCOMthingy")
>> pycomhack.SetSession("A",4)

The SetSession call works fine (as do any others).  So I put it into a
script and try it, same error. and if I trim it down, it still dies on
the "from win32com..." line.

Honestly I am not sure where to begin. I know I can build python debug
and run it in the debugger, but I figured I would ask before I resort to
that (though I suspect I will have to).  Does anyone have any ideas of
what to look at before I go there?  Or pehaps someone has experienced
something similar?

All punditry happily accepted.

Thanks
Guy Umbright
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20030604/867a182b/attachment.htm


More information about the Python-win32 mailing list