In a recent download of ZSI-2.0-rc2, I encountered the
following error when attempting to use the SetAUTH method:
>>> obj.binding.SetAUTH('1','user','psw')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "C:\Python24\lib\site-packages\ZSI\client.py",
line 47, in __call__
requesttypecode=TC.Any(self.name, aslist=0))
File "C:\Python24\lib\site-packages\ZSI\client.py",
line 172, in RPC
self.Send(url, opname, obj, **kw)
File "C:\Python24\lib\site-packages\ZSI\client.py",
line 218, in Send
if self.auth_style & AUTH.zsibasic:
TypeError: unsupported operand type(s) for &: 'str' and
'int'
by changing the & on line 218 of client.py to: and, I
was able to correctly utilize the method.
Logged In: YES
user_id=705459
You are passing a string "1" as the auth type. Look at the top of auth.py and
you will see that the class AUTH, which contains the auth types, has attributes
with integer values. ZSI.auth.AUTH.httpbasic to be specific.
& is a valid op on two ints, so no bug.