Commits

Jason R. Coombs committed 0f88aca

Always encode login_screen (no longer needs ntob). Fixes #1132.

Comments (0)

Files changed (1)

cherrypy/lib/cptools.py

 import re
 
 import cherrypy
-from cherrypy._cpcompat import basestring, ntob, md5, set
+from cherrypy._cpcompat import basestring, md5, set
 from cherrypy.lib import httputil as _httputil
 
 
         pass
 
     def login_screen(self, from_page='..', username='', error_msg='', **kwargs):
-        return ntob("""<html><body>
+        return (u"""<html><body>
 Message: %(error_msg)s
 <form method="post" action="do_login">
     Login: <input type="text" name="username" value="%(username)s" size="10" /><br />
     <input type="hidden" name="from_page" value="%(from_page)s" /><br />
     <input type="submit" />
 </form>
-</body></html>""" % {'from_page': from_page, 'username': username,
-                     'error_msg': error_msg}, "utf-8")
+</body></html>""" % vars()).encode("utf-8")
 
     def do_login(self, username, password, from_page='..', **kwargs):
         """Login. May raise redirect, or return True if request handled."""