cubicweb/server/utils.py
branch3.26
changeset 12280 577e8d3896b4
parent 12193 e4ee04d442be
child 12508 a8c1ea390400
--- a/cubicweb/server/utils.py	Thu Feb 15 11:02:48 2018 +0100
+++ b/cubicweb/server/utils.py	Thu Feb 15 11:04:20 2018 +0100
@@ -26,7 +26,7 @@
 from threading import Thread
 from getpass import getpass
 
-from six import PY2
+from six import PY2, text_type
 from six.moves import input
 
 from passlib.utils import handlers as uh, to_hash_str
@@ -106,7 +106,7 @@
         while not user:
             user = input('login: ')
         if PY2:
-            user = unicode(user, sys.stdin.encoding)
+            user = text_type(user, sys.stdin.encoding)
     passwd = getpass('%s: ' % passwdmsg)
     if confirm:
         while True: