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

Brian Jarrett bjarrett at garcoschools.org
Mon Apr 14 08:08:23 EDT 2003


I had a problem similar to this on an XP workstation recently.

I had found that when I was using PythonWin as my editor, that it was having problem with indents and I would get an error message in the interactive window sometimes when hitting <Enter>.  I turned on the End-of-Line markers and found that some of my lines had only a "CR" showing at the end, not a "CR LF".  I had to go to the end of the line, delete and then hit <enter> again to get it to show up correctly.

I've also had problems with trying to import other .py files that were in the same directory.  I would get a "not found" error unless I opened up the referenced file and saved.  Then the original script doing the import would find the file just fine.

I hope this helps some, just a few other wierd things I've found in working with Python.  I'm using ActivePython 2.2.2 by the way.

Brian

-----Original Message-----
From: Guy Umbright [mailto:gumbright at taltrade.com]
Sent: Friday, April 11, 2003 1:01 PM
To: python-win32 at python.org
Subject: [python-win32] Prob w/ win32com under XP (very weird) - addenda


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


This electronic mail message and any attached files contain information intended for the exclusive use of the individual or entity to whom it is addressed and may contain information that is proprietary, privileged, confidential and/or exempt from disclosure under applicable law.  If you are not the intended recipient, you are hereby notified that any viewing, copying, disclosure or distribution of this information may be subject to legal restriction or sanction.  Please notify the sender, by electronic mail or telephone, of any unintended recipients and delete the original message without making any copies.

_______________________________________________
Python-win32 mailing list
Python-win32 at python.org
http://mail.python.org/mailman/listinfo/python-win32



More information about the Python-win32 mailing list