[session] user.login is usually an unicode string, so implements __unicode__ instead of __str__ stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 26 Feb 2010 06:59:16 +0100
branchstable
changeset 4703 4e803c30b7db
parent 4702 d9e51820d0c2
child 4704 a1ac5a453146
[session] user.login is usually an unicode string, so implements __unicode__ instead of __str__
server/session.py
--- a/server/session.py	Fri Feb 26 06:57:02 2010 +0100
+++ b/server/session.py	Fri Feb 26 06:59:16 2010 +0100
@@ -71,9 +71,9 @@
         self._threads_in_transaction = set()
         self._closed = False
 
-    def __str__(self):
-        return '<%ssession %s (%s 0x%x)>' % (self.cnxtype, self.user.login,
-                                             self.id, id(self))
+    def __unicode__(self):
+        return '<%ssession %s (%s 0x%x)>' % (
+            self.cnxtype, unicode(self.user.login), self.id, id(self))
 
     def hijack_user(self, user):
         """return a fake request/session using specified user"""