0.118.0
Fixes
- 🐛 Fix support for
StreamingResponse
s with dependencies withyield
orUploadFile
s, close after the response is done. PR #14099 by @tiangolo.
Before FastAPI 0.118.0, if you used a dependency with yield
, it would run the exit code after the path operation function returned but right before sending the response.
This change also meant that if you returned a StreamingResponse
, the exit code of the dependency with yield
would have been already run.
For example, if you had a database session in a dependency with yield
, the StreamingResponse
would not be able to use that session while streaming data because the session would have already been closed in the exit code after yield
.
This behavior was reverted in 0.118.0, to make the exit code after yield
be executed after the response is sent.
You can read more about it in the docs for Advanced Dependencies - Dependencies with yield
, HTTPException
, except
and Background Tasks. Including what you could do if you wanted to close a database session earlier, before returning the response to the client.
Docs
- 📝 Update
tutorial/security/oauth2-jwt/
to usepwdlib
with Argon2 instead ofpasslib
. PR #13917 by @Neizvestnyj. - ✏️ Fix typos in OAuth2 password request forms. PR #14112 by @alv2017.
- 📝 Update contributing guidelines for installing requirements. PR #14095 by @alejsdev.
Translations
- 🌐 Sync German docs. PR #14098 by @nilslindemann.
Internal
- ⬆ [pre-commit.ci] pre-commit autoupdate. PR #14103 by @pre-commit-ci[bot].
- ♻️ Refactor sponsor image handling. PR #14102 by @alejsdev.
- 🐛 Fix sponsor display issue by hiding element on image error. PR #14097 by @alejsdev.
- 🐛 Hide sponsor badge when sponsor image is not displayed. PR #14096 by @alejsdev.