Hi Mark,

Thanks for the info, I had only just inserted the error handling from 
the example from your book, and
although it was staring me in the face I was not concentrating on that 
message, I was looking at the late/early binding info.

I had missed supplying one argument in that method call, (my fault for 
not being careful enough) so the string had moved into the int place.

This has now highlighted to me, since the arguments to the functions all 
have default values, being short an argument is not flagged as an error 
by python, and why I missed it.

Lesson learnt: is to be more careful with arguments and types.

Thanks again
Steve


Mark Hammond wrote:
>> Hi Mark,
>>
>> Thanks for the response.
>>
>> Both those methods you highlighted resulted in the following output
>>
>> D:\tempSVNPyFiles\clearcase>testcom.py
>> CC: <win32com.gen_py.ClearCase Automation Library 6.0.IClearCase
>> instance at 0x16083224>
>> --------------------------------------------------------
>> CQ: <win32com.gen_py.None.Session>
>> Traceback (most recent call last):
>>   File "D:\tempSVNPyFiles\clearcase\testcom.py", line 28, in <module>
>>     cq_session.UserLogon( 'sgeorge', 'sgeorge', "OSI", "" );
>>   File
>> "C:\DOCUME~1\SGEORG~1.OSI\LOCALS~1\Temp\gen_py\2.5\B805FDF6-BE
>> A8-11D1-B36D-00A0C9851B52x0x1x0.py",
>> line 2816, in UserL
>> ogon
>>     , password, database_name, session_type, database_set)
>> ValueError: invalid literal for int() with base 10: ''
>>     
>
> The function appears to want an int, but you are passing a string.  Even
> with type info, python does not cooerce string to ints, just like it doesnt
> with:
>
>   print "Num is %d" % ('foo',)
>
>   
>> The ValueError is the initial problem I had before I got sidetracked
>> with EarlyBinding
>>
>> However I just check with you that
>> <win32com.gen_py.None.Session>
>> Is correct when getting binding by this method?
>>     
>
> Although it looks strange, it is correct, yes.
>
> Mark
>
>
>   
   
_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to