https://github.com/exavolt/python-phpass/blob/master/phpass/__init__.py#L102 add salt = salt.encode('utf-8') somewhere after that line