|
Download README.md from Razio05/Python313-FastAPI-JWT-Passlib-Bcrypt-Fix: direct link, hf CLI and curl.
- Browser
- Download file 1.58 kB
-
https://huggingface.co/Razio05/Python313-FastAPI-JWT-Passlib-Bcrypt-Fix/resolve/main/README.md
- Command line
-
hf download hf://Razio05/Python313-FastAPI-JWT-Passlib-Bcrypt-Fix/README.md
-
curl -L -o README.md https://huggingface.co/Razio05/Python313-FastAPI-JWT-Passlib-Bcrypt-Fix/resolve/main/README.md
1.58 kB
metadata
license: mit
tags:
- fastapi
- python-3.13
- bcrypt
- passlib
- jwt-authentication
π‘οΈ 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: