[python-win32] pb with string conversion to float and GetObject call

popov outlook at evpopov.com
Wed Sep 10 17:07:59 EDT 2003


Here's a strange one:

print float('8.4')

Works as expected.
But:

import win32com.client
obj = win32com.client.GetObject ("winmgmts:")
print float('8.4')

Throws a 'ValueError: invalid literal for float(): 8.4' exception on the
print line !
If you use '8,4' instead of '8.4', then it works (!). So it seems that some
locals have been modified here by the call to GetObject (without this call -
leaving only the import statement - the problem does not show up).
Note that using 'LDAP:' instead of 'winmgmts:', everything is ok. So maybe
the culprit is the winmgmts provider...
If someone could test this and let me know the results. Thx.

My system: W2k Server english, python 2.3, pywin32 for python 2.3.




More information about the Python-win32 mailing list