About wmi

Tim Golden mail at timgolden.me.uk
Tue Jul 15 18:18:53 CEST 2008


patrol wrote:
> Situation (2):
>     result = new_process.terminate()
>   File "C:\Python25\lib\wmi.py", line 494, in __getattr__
>     handle_com_error (error_info)
>   File "C:\Python25\lib\wmi.py", line 190, in handle_com_error
>     raise x_wmi, "\n".join (exception_string)
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xb7 in position
> 14: ordinal
>  not in range(128)
> 
> BTW, My windows' languange is Chinese.


Well that looks embarrassingly like a complete lack
of unicode-awareness in the wmi module. Would you
mind trying this version:

http://timgolden.me.uk/wmi-project/wmi.py

which is a copy of the svn trunk to see if that
improves the UnicodeDecode error, please? I'll
try to get an install of a non-English edition of
Windows but, as you might imagine, I normally run
the UK version so don't hit these kind of issue
myself.

TJG



More information about the Python-list mailing list