#21248 closed Bug (fixed)
Password tests failure on Django 1.5 (bcrypt related)
| Reported by: | Anssi Kääriäinen | Owned by: | nobody |
|---|---|---|---|
| Component: | contrib.auth | Version: | 1.5 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
I get this failure when running Django's test suite on stable/1.5.x (at commit f8393edb52e3dc73185f2496bfa08463fa4ffa09):
======================================================================
ERROR: test_bcrypt (django.contrib.auth.tests.hashers.TestUtilsHashPass)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/akaariai/Programming/py27_venv/local/lib/python2.7/site-packages/django/contrib/auth/tests/hashers.py", line 100, in test_bcrypt
self.assertTrue(check_password('lètmein', encoded))
File "/home/akaariai/Programming/py27_venv/local/lib/python2.7/site-packages/django/contrib/auth/hashers.py", line 55, in check_password
is_correct = hasher.verify(password, encoded)
File "/home/akaariai/Programming/py27_venv/local/lib/python2.7/site-packages/django/contrib/auth/hashers.py", line 293, in verify
return constant_time_compare(data, bcrypt.hashpw(force_bytes(password), data))
File "/home/akaariai/Programming/py27_venv/local/lib/python2.7/site-packages/bcrypt/__init__.py", line 91, in hashpw
raise TypeError("Unicode-objects must be encoded before hashing")
TypeError: Unicode-objects must be encoded before hashing
The failure happens only when bcrypt is installed. Tested bcrypt 1.0.0-1.0.2. The failure happens both on Python 2.7 and 3.2. It seems the error is there in first 1.5 release, too. The error isn't present in 1.6.x.
Change History (3)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Django 1.5.x doesn't work with bcrypt, only with py-bcrypt (confirmed by dstufft). Skipping the test_bcrypt test for bcrypt library (but not py-bcrypt) seems good enough for now.
This commit seems to skip the test for bcrypt, but not for py-bcrypt.