Python2.3 and win32all wmi problems.

Paul Moore paul.moore at atosorigin.com
Wed Jul 2 05:19:41 EDT 2003


tim.golden at viacom-outdoor.co.uk (Tim Golden) wrote in message news:<8360efcd.0306040503.24cd4b7c at posting.google.com>...
> murtaza_hakim at yahoo.com (Murtaza Hakim) wrote
> 
> MH> when I try to access the Windows Management
> MH> Instrumentation (WMI) classes I get a traceback.  
> MH> This operation works fine using Python 2.2.
> 
> [ snip traceback ]
> 
> Just to clarify, I believe it is the version of win32all 
>  which you are using, and not the version of Python, which
>  is the source of the error. I get the same error running
>  win32all-153 under Python 2.2.2.

I am also hitting this problem - it seems to be an issue with new code
in win32all build 153, in pythoncom.

As a workaround, if you go to Mark Hammond's website, and follow the
link to "Regular Snapshot Builds"
(http://starship.python.net/crew/mhammond/win32/CVSSnapshotBuilds.html)
you can download the 20021220 build. It's an installer executable, but
you can open it in WinZip (or similar) and extract pythoncom23.dll
from it. Replace the existing copy of this file (in your
C:\WINNT\SYSTEM32 directory) with this one, and things seem OK.

For what it's worth (Mark may be interested) the relevant change seems
to be in pywin32/com/win32com/src/PythonCOM.cpp where a call to
PyArg_ParseTuple was changed from ``PyArg_ParseTuple(args,
"s|O:MkParseDisplayName", &displayName, &obBindCtx)`` to
``PyArg_ParseTuple(args, "et|O:MkParseDisplayName",
Py_FileSystemDefaultEncoding, &displayName, &obBindCtx)``. I don't
know what this is doing, but it's pretty much where the traceback is
pointing...

Paul.




More information about the Python-list mailing list