#29652: BCryptSHA256PasswordHasher fails to encode() ----------------------------------------+------------------------ Reporter: Drahflow | Owner: nobody Type: Bug | Status: new Component: contrib.auth | Version: 2.1 Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 0 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 1 UI/UX: 0 | ----------------------------------------+------------------------ {{{ #!/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. -- Ticket URL: <https://code.djangoproject.com/ticket/29652> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/051.b62c0fb6805a88641e543374318fce20%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.