﻿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
29652	Document that Django 2.1 dropped compatbility with py-bcrypt	Jens-Wolfhard Schicke-Uffmann	nobody	"The BCryptSHA256PasswordHasher tries to decode the result of bcrypt.hashpw, which however is already a str (and not bytes).

{{{
#!/usr/bin/env python

from django.contrib.auth.hashers import BCryptSHA256PasswordHasher

hasher = BCryptSHA256PasswordHasher()
hasher.encode('secret', hasher.salt())
}}}
results in
{{{
Traceback (most recent call last):
  File ""issue.py"", line 6, in <module>
    hasher.encode('secret', hasher.salt())
  File ""/mnt/crypt/drahflow/.virtualenvs/NDA/lib/python3.6/site-packages/django/contrib/auth/hashers.py"", line 417, in encode
    return ""%s$%s"" % (self.algorithm, data.decode('ascii'))
AttributeError: 'str' object has no attribute 'decode'
}}}

The bug was introduced in: https://github.com/django/django/commit/16c5a334ff3ad9d8b3cd1314562c7af20a2a7c7d
Other hashers might be affected, I didn't check."	Bug	closed	contrib.auth	2.1	Normal	fixed		Herbert Fortes Jens-Wolfhard Schicke-Uffmann	Accepted	0	0	0	0	1	0
