In the book, in example 3 at http://web2py.com/books/default/chapter/29/09/access-control?search=motp#Other-options-that-can-be-applied-over-the-examples-before- and if using Python 3, the line `hash = md5(to_hash).hexdigest()[:6]` should be `hash = md5(to_hash.encode(encoding='utf8')).hexdigest()[:6]`