Replies: 2 comments
-
|
The only viable solution I can think of at the moment is using Related issue: #10857 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Hi ! I've got the same issue ! I need to stay below 0.106.0 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
test_serveused to work fine in v 0.105.0, but gives an exception in 0.106.0:I suspect it has to do with the breaking change in 0.106.0 and would like to get a suggestion what is the idiomatic way of serving a temporary file.
The technique I used is also suggested in this SO discussion: https://stackoverflow.com/a/72535413/18775, but it seems this way is broken now.
There is a discussion here #8633 where a StreamingResponse is used--in my example
test-no-injectendpoint works fine andtest_serve_no_injectdemonstrates it, however it is prone to an file descriptor leak in case response is broken halfway.And here #2152 a background task is used to delete a temporary file.
I am in search for an idiomatic way, which is going to decrease the chances I have to rework this bit again.
Operating System
macOS
Operating System Details
I also tried it on Linux
FastAPI Version
0.106.0
Pydantic Version
1.10.13
Python Version
Python 3.10.13
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions