[python-win32] Re: wmi + pythonservice : multithreading issue s

Tim Golden tim.golden at viacom-outdoor.co.uk
Tue Aug 31 09:42:24 CEST 2004


| > As this "Future Warning" thing seems to come from win32com, 
| sure that
| > Mark Hammond knows about it.
| 
| Actually, the warning in your original message was:
| 
| D:\Python23\lib\site-packages\wmi.py:126: FutureWarning: 
| hex()/oct() of
| negative int will return a signed string in Python 2.4 and up
|    exception_string = ["%s - %s" % (hex (hresult_code), hresult_name)]
| 
| Which looks like it is in wmi.py, not win32com.

Just to clarify, the warning clearly arises from my
hex (hresult_code). For those who don't know, doing this
in Python <= 2.3.x:

print hex (-1)

will generate this (wrapped slightly for readability):

<output>

Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print hex (-1)
__main__:1: FutureWarning: hex()/oct() of negative int 
 will return a signed string in Python 2.4 and up
0xffffffff
>>>

</output>

Since my code is calling hex() on the hresult, you'll always get
this error unless you use the warnings module to disable it.

TJG

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


More information about the Python-win32 mailing list