[Kimchi-devel] [PATCH] issue #330: Properly log the error message when login fails

Crístian Viana vianac at linux.vnet.ibm.com
Thu Mar 6 15:46:35 UTC 2014


Am 06-03-2014 12:12, schrieb Sheldon:
> AFAK, seems two types has no string representation, one is unicode and 
> another is object derived from nothing.
The statement if not isinstance(value, unicode), which is in the sample 
code above, makes sure that we will not try to convert a unicode object 
to string (only those who have a different type).

And an object derived from nothing also has a string representation. 
Take a look at this example:

 >>> class X():
...     def x(self):
...             pass
...
 >>> a = X()
 >>> print str(a)
<__main__.X instance at 0x7f8fe13d4b00>
 >>> print "this is a string: %s." % a
this is a string: <__main__.X instance at 0x7f8fe13d4b00>.

> But I'm not worry about it.
> IMO, no one will not pass this instance of object to KimchiException 
> as args.
IMO, we should never trust that the users/developers will pass the 
correct parameters to our code. Eventually, someone will forget that, 
and then we will have one more bug ;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/kimchi-devel/attachments/20140306/f73131eb/attachment.html>


More information about the Kimchi-devel mailing list