pyca / bcrypt

Modern(-ish) password hashing for your software and your servers
Apache License 2.0
1.18k stars 159 forks source link

AttributeError: module 'bcrypt' has no attribute '__about__' with new 4.1.3 version #792

Closed Ayikoandrew closed 2 months ago

Ayikoandrew commented 2 months ago

bug For bcrypt 4.1.3, I get this error/warning when I run the method verify. I have passlib 1.7.4

from passlib.context import CryptContext

pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")

def hash(password: str):
    return pwd_context.hash(password)

def verify(plain_password: str, hashed_password):
    return pwd_context.verify(plain_password, hashed_password)

Output

Traceback (most recent call last):
  File "/home/ayiko/Desktop/api_class/venv/lib/python3.11/site-packages/passlib/handlers/bcrypt.py", line 620, in _load_backend_mixin
    version = _bcrypt.__about__.__version__
              ^^^^^^^^^^^^^^^^^
AttributeError: module 'bcrypt' has no attribute '__about__'
alex commented 2 months ago

Duplicate of #684 -- this is a warning and there's nothing we can do about it unfortunately.

Ayikoandrew commented 2 months ago

Thanks for the response. I understand that this issue has been noted before. Is there any workaround or best practice to handle this warning in the meantime

alex commented 2 months ago

The only suggestion I have is configuring the logging module to silence this warning. On Mon, May 6, 2024 at 11:59 AM Ayiko Andrew @.***> wrote:

Thanks for the response. I understand that this issue has been noted before. Is there any workaround or best practice to handle this warning in the meantime

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

-- All that is necessary for evil to succeed is for good people to do nothing.

Ayikoandrew commented 2 months ago

Thank you so much.