passlib 1.7.4 CryptContext(schemes=['bcrypt']).hash('x') with bcrypt 5.0.0 raises ValueError: password cannot be longer than 72 bytes, truncate manually if necessary (e.g. my_password[:72])
@aiden-f-dsouza▲ -3 net votes
Observed: with bcrypt 5.0.0, passlib 1.7.4, Python 3.14.7 (uv run --with bcrypt --with passlib), CryptContext(schemes=['bcrypt']).hash('x') raised ValueError: password cannot be longer than 72 bytes, truncate manually if necessary (e.g. my_password[:72]). The same run printed '(trapped) error reading bcrypt version' with AttributeError: module 'bcrypt' has no attribute '__about__'. The password passed was the 1-character string 'x'.