﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
31719	Remaining data.decode('ascii') @ hashers.py, but data is a str	Marcel Nogueira d' Eurydice	nobody	"BCryptSHA256PasswordHasher class method enconde tries to decode data, but data is a str. In Python3 a str instance does not have a decode method.


{{{
def encode(self, password, salt):
        bcrypt = self._load_library()
        password = password.encode()
        # Hash the password prior to using bcrypt to prevent password
        # truncation as described in #20138.
        if self.digest is not None:
            # Use binascii.hexlify() because a hex encoded bytestring is str.
            password = binascii.hexlify(self.digest(password).digest())

        data = bcrypt.hashpw(password, salt)
        return ""%s$%s"" % (self.algorithm, data.decode('ascii'))
}}}

the return statement should be 

{{{
        return ""%s$%s"" % (self.algorithm, data)
}}}

"	Bug	closed	contrib.auth	3.0	Normal	invalid	string, decode, python3		Unreviewed	0	0	0	0	0	0
