From e08611447810c2721e9457443922c62b59c6fc98 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Thu, 3 Jan 2008 22:04:34 +0000 Subject: [PATCH] Unicode passwords containing special characters would break sha.new(). Now they're encoded as utf8 first. --- model/User.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/User.py b/model/User.py index 5c0054f..58b7e6d 100644 --- a/model/User.py +++ b/model/User.py @@ -73,7 +73,7 @@ class User( Persistent ): if password is None or len( password ) == 0: return None - return sha.new( salt + password ).hexdigest() + return sha.new( ( salt + password ).encode( "utf8" ) ).hexdigest() def check_password( self, password ): """