Solved: AttributeError: module 'bcrypt' has no attribute '__about__' in Python 3.12 & 3.13 (FastAPI JWT Auth)
🛡️ Fixing ValueError: password cannot be longer than 72 bytes in Python 3.12 / 3.13 (passlib + bcrypt) When deploying FastAPI authentication routes using passlib[bcrypt] on Python 3.12 or Python 3.13, newer versions
🛡️ Fixing ValueError: password cannot be longer than 72 bytes in Python 3.12 / 3.13 (passlib + bcrypt)
When deploying FastAPI authentication routes using passlib[bcrypt] on Python 3.12 or Python 3.13, newer versions of bcrypt (>= 4.1.0) raise:
ValueError: password cannot be longer than 72 bytes, truncate manually if necessary
during passlib's internal detect_wrap_bug startup check.
✅ The Instant Production Fix
Pin bcrypt==4.0.1 alongside passlib[bcrypt] in your requirements.txt:
fastapi
uvicorn
passlib[bcrypt]
bcrypt==4.0.1
python-jose[cryptography]
pydantic[email]
🎁 Building a FastAPI + AI Micro-SaaS in 2026?
Don't waste 30+ hours debugging Python 3.13 auth, JWT bearer guards, SaaS user credit quotas, and Google Gemini structured JSON outputs from scratch:
- 📘 Download the Free 2026 FastAPI + Gemini Architecture Blueprint ($0)
- 🚀 Get ShipAI v2.0 Commercial Micro-SaaS Boilerplate (30% OFF with code
BLUEPRINT30)
🚀 Try the Live Sandbox, Install via PyPI, or Grab the Full Source Code
- 🐍 Install the Official Python CLI Blueprint from PyPI:
pip install fastapi-gemini-blueprint
shipai-blueprint
- 🤗 Try the Live Interactive Sandbox on Hugging Face Spaces: 👉 https://huggingface.co/spaces/Razio05/shipai-fastapi-gemini-sandbox
- 📘 Download the Free 2026 Architecture Blueprint & Cheat Sheet ($0): 👉 https://yahiaoui26.gumroad.com/l/fastapi-gemini-blueprint
-
⚡ Get the Full ShipAI v2.0 Commercial Boilerplate (FastAPI + Gemini + 5 SaaS Presets + Streamlit UI + Docker):
-
20% OFF Launch Link (
$31.20instead of$39): https://yahiaoui26.gumroad.com/l/shipai-pro/LAUNCH20 -
🌍 50% OFF Starter PPP Link (
$19.50for indie devs & students): https://yahiaoui26.gumroad.com/l/shipai-pro/PPP50?option=_fn2rPhRYh44JnsnEUq4Gg%3D%3D&wanted=true
-
20% OFF Launch Link (
- ⭐ Star the Open-Source Repositories on GitHub: 👉 https://github.com/RAZIO05/fastapi-gemini-2026-blueprint
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.