Passing a stream into EnvironBuilder.get_environ()
#2844
Unanswered
AbdealiLoKo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was using
werkzeug.test.EnvironBuilder.get_environ()
and realized that when I gave a pretty large file, this function was taking a fair amount of RAM.I was assuming that it would simply take the
input_stream
and pass it to the other side.I then realized that when I give a
input_stream
andcontent_length
the function was still reading the entire stream into RAM, and then re-calculating thecontent_length
Reference:
https://github.com/pallets/werkzeug/blob/3.0.1/src/werkzeug/test.py#L681-L686
Is there a more optimal way for me to simply provide the
content_length
andinput_stream
so that werkzeug takes my values instead of reading the entire stream into RAM ?Beta Was this translation helpful? Give feedback.
All reactions