Bcrypt.checkpw возвращает TypeError: объекты Unicode должны быть закодированы перед проверкой ⇐ Python
Bcrypt.checkpw возвращает TypeError: объекты Unicode должны быть закодированы перед проверкой
I am calling bcrypt.checkpw to check unencrypted password matches with hashed password stored in the credential database, but receive
TypeError: Unicode-objects must be encoded before checking
How should I resolve this issue? Any suggestion?
I installed python 2.7.6, and bcrypt 3.1.1
I have the following code:
def check_password(password, hashed_password) if not bcrypt.checkpw(password, hashed_password): raise InvalidCredentials("403 Forbidden") else: return true And receive the following error:
File "/home/qt/virtualenv/lib/python2.7/site-packages/bcrypt/init.py", line 100, in checkpw
raise TypeError("Unicoed-objects must be encoded before checking")
TypeError: Unicode-objects must be encoded before checking
I looked into bcrypt/__init__.py, but I'm not sure why
def checkpw(password, hashed_password): if (isinstance(password, six.text_type) or isinstance(hashed_password, six.text_type)): raise TypeError("Unicode-objects must be encoded before checking")
Источник: https://stackoverflow.com/questions/405 ... re-checkin
I am calling bcrypt.checkpw to check unencrypted password matches with hashed password stored in the credential database, but receive
TypeError: Unicode-objects must be encoded before checking
How should I resolve this issue? Any suggestion?
I installed python 2.7.6, and bcrypt 3.1.1
I have the following code:
def check_password(password, hashed_password) if not bcrypt.checkpw(password, hashed_password): raise InvalidCredentials("403 Forbidden") else: return true And receive the following error:
File "/home/qt/virtualenv/lib/python2.7/site-packages/bcrypt/init.py", line 100, in checkpw
raise TypeError("Unicoed-objects must be encoded before checking")
TypeError: Unicode-objects must be encoded before checking
I looked into bcrypt/__init__.py, but I'm not sure why
def checkpw(password, hashed_password): if (isinstance(password, six.text_type) or isinstance(hashed_password, six.text_type)): raise TypeError("Unicode-objects must be encoded before checking")
Источник: https://stackoverflow.com/questions/405 ... re-checkin
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Как исправить TypeError: объекты Unicode должны быть закодированы перед хешированием?
Anonymous » » в форуме Python - 0 Ответы
- 21 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Должны ли ожидаемые результаты E2E-тестов быть жестко закодированы или рассчитаны?
Anonymous » » в форуме JAVA - 0 Ответы
- 93 Просмотры
-
Последнее сообщение Anonymous
-